/*
 * Authentication Pages CSS
 * auth/login.html から分離
 * 認証画面・SMS認証UI
 * カラーパレットはmain.cssのCSS変数を参照
 */

/* Authentication Container - Neutral (Green-tinted) palette */
.auth-container {
    background: var(--gradient-dark);
    min-height: 100vh;
}

.auth-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-xl);
}

/* Phone Input Components */
.phone-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

/* 国番号入力ラッパー（テキスト入力+ドロップダウンボタン） */
.country-code-wrapper {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
}

/* 国番号テキスト入力（編集可能） */
.country-code-input {
    width: 4.5rem;
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background-color: var(--neutral-100);
    border: 2px solid var(--border-default);
    border-right: none;
    border-radius: 8px 0 0 8px;
    transition: all 0.2s ease;
    text-align: center;
}

.country-code-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 57, 50, 0.1);
    background-color: white;
    z-index: 1;
}

.country-code-input:hover {
    background-color: var(--neutral-200);
}

/* ドロップダウンボタン（アイコン表示用） */
.country-code-dropdown-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    background-color: var(--neutral-200);
    border: 2px solid var(--border-default);
    border-left: none;
    border-right: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-code-dropdown-btn:hover {
    background-color: var(--neutral-300);
    color: var(--text-primary);
}

.country-code-dropdown-btn:focus {
    outline: none;
    background-color: var(--neutral-300);
}

/* セレクタをボタンに重ねて配置（クリック可能） */
.country-code-select {
    position: absolute;
    right: 0;
    top: 0;
    width: 24px;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 旧スタイル（後方互換） */
#country_code {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--neutral-100);
    border: 2px solid var(--border-default);
    border-right: none;
    border-radius: 8px 0 0 8px;
    padding: 12px 32px 12px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 90px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b8a7f'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    transition: all 0.2s ease;
}

#country_code:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 57, 50, 0.1);
}

#country_code:hover {
    background-color: var(--neutral-200);
}

.country-code {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
}

.phone-input,
.phone-input-group input[type="tel"].phone-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 10px 12px 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background-color: white;
    border: 2px solid var(--border-default) !important;
    border-radius: 0 8px 8px 0 !important;
    border-left: none !important;
    margin-left: 0 !important;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.phone-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 57, 50, 0.1);
}

/* RTL サポート */
[dir="rtl"] .country-code-wrapper {
    order: 1;
    flex-direction: row-reverse;
}

[dir="rtl"] .country-code-input {
    border-radius: 0 8px 8px 0;
    border-right: 2px solid var(--border-default);
    border-left: none;
}

[dir="rtl"] .country-code-dropdown-btn {
    border-left: none;
}

[dir="rtl"] #country_code {
    border-radius: 0 8px 8px 0;
    border-right: 2px solid var(--border-default);
    border-left: none;
    background-position: left 8px center;
    padding: 12px 12px 12px 32px;
}

[dir="rtl"] .phone-input {
    border-radius: 8px 0 0 8px !important;
    border-right: none !important;
    border-left: 2px solid var(--border-default) !important;
    padding: 10px 16px 10px 12px;
}

/* PIN Input Components */
.pin-input-group {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
}

.pin-digit {
    width: 40px;
    height: 48px;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 2px solid var(--border-default);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pin-digit:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 57, 50, 0.1);
}

.pin-digit.filled {
    border-color: var(--color-primary);
    background-color: var(--green-50);
    color: var(--neutral-800);
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .auth-card {
        margin: 16px;
        padding: 24px;
    }

    .pin-input-group {
        gap: 0.25rem;
    }

    .pin-digit {
        width: 36px;
        height: 44px;
        font-size: 1.125rem;
    }
}
