/**
 * WKL_HT001 作業開始画面 スタイルシート
 * HT（ハンディターミナル）向けモバイルファースト設計
 */

/* ===========================
   リセットとベーススタイル
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ===========================
   コンテナ
   =========================== */
.ht-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

/* ===========================
   ヘッダー
   =========================== */
.ht-header {
    flex-shrink: 0;
    padding: 12px 16px;
    background-color: #006f5e;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ht-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ht-user-info {
    font-size: 13px;
    display: flex;
    gap: 12px;
    opacity: 0.95;
}

/* ===========================
   メインコンテンツ
   =========================== */
.ht-main {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===========================
   プロンプトエリア
   =========================== */
.prompt-area {
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #006f5e;
}

.prompt-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    display: block;
}

/* ===========================
   入力エリア
   =========================== */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.ht-input,
.ht-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    transition: border-color 0.2s;
}

.ht-input:focus,
.ht-select:focus {
    outline: none;
    border-color: #006f5e;
    background-color: #f8f9fa;
}

.ht-input::placeholder {
    color: #999;
}

.ht-select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* ===========================
   メッセージエリア
   =========================== */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    animation: slideIn 0.3s ease-out;
}

.error-message {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.success-message {
    background-color: #efe;
    color: #3a3;
    border: 1px solid #cfc;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   ローディング表示
   =========================== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #006f5e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-indicator p {
    font-size: 14px;
    color: #666;
}

/* ===========================
   フッター
   =========================== */
.ht-footer {
    flex-shrink: 0;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===========================
   ボタン
   =========================== */
.ht-button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    text-align: center;
}

.ht-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ht-button-primary {
    background-color: #006f5e;
    color: #fff;
}

.ht-button-primary:hover:not(:disabled) {
    background-color: #005a4b;
}

.ht-button-primary:active:not(:disabled) {
    background-color: #003d7a;
}

.ht-button-tertiary {
    background-color: #e0e0e0;
    color: #333;
}

.ht-button-tertiary:hover:not(:disabled) {
    background-color: #d0d0d0;
}

.ht-button-tertiary:active:not(:disabled) {
    background-color: #c0c0c0;
}

/* ===========================
   レスポンシブ対応
   =========================== */
@media (min-width: 768px) {
    .ht-footer {
        flex-direction: row;
        justify-content: flex-end;
    }

    .ht-button {
        width: auto;
        min-width: 120px;
    }
}

/* ===========================
   アクセシビリティ
   =========================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ハイコントラストモード対応 */
@media (prefers-contrast: high) {
    .ht-input,
    .ht-select {
        border-width: 3px;
    }

    .ht-button {
        border: 2px solid currentColor;
    }
}
