/* assets/css/auth.css */

/* ─── Auth Layout ───────────────────────────────────────── */
.auth-container {
    min-height: calc(100vh - 73px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ─── Header ─────────────────────────────────────────────── */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ─── Buttons ────────────────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.google-btn {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.google-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ─── Divider ────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider::before {
    margin-right: .6em;
}

.divider::after {
    margin-left: .6em;
}

/* ─── Auth Links ─────────────────────────────────────────── */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.auth-links a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* ─── OTP Inputs ─────────────────────────────────────────── */
.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: nowrap;
}

/* ใช้ specificity สูงเพื่อ override global input styles จาก style.css */
#otpCard .otp-inputs input,
.otp-inputs input[type="text"] {
    width: 64px;
    height: 64px;
    font-size: 1.7rem;
    font-weight: 800;
    text-align: center;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(10, 10, 30, 0.9) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    outline: none;
    caret-color: #818cf8;
    transform: none !important;
    /* ยกเลิก translateY จาก global rule */
    box-shadow: none;
    padding: 0;
    width: 64px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

#otpCard .otp-inputs input:hover,
.otp-inputs input[type="text"]:hover {
    background: rgba(10, 10, 30, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.25);
    transform: none !important;
}

#otpCard .otp-inputs input:focus,
.otp-inputs input[type="text"]:focus {
    border-color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.18) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    transform: none !important;
}

#otpCard .otp-inputs input.filled,
.otp-inputs input[type="text"].filled {
    border-color: #4f46e5;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.otp-inputs input::placeholder {
    color: rgba(255, 255, 255, 0.12) !important;
    -webkit-text-fill-color: rgba(255, 255, 255, 0.12) !important;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .auth-container {
        padding: 5rem 1rem 2rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: 18px;
    }

    .auth-header h2 {
        font-size: 1.6rem;
    }

    .otp-inputs {
        gap: 6px;
    }

    #otpCard .otp-inputs input,
    .otp-inputs input[type="text"] {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.3rem;
    }

    .auth-btn {
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    #otpCard .otp-inputs input,
    .otp-inputs input[type="text"] {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem;
    }

    .auth-container {
        padding: 4rem 0.5rem 1.5rem;
    }
}

/* ─── Loading Button ─────────────────────────────────────── */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}