/* Login Page — Centered Card OTP Design */

body.auth-body {
    background: var(--surface, #faf4e8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    font-family: var(--font-body, 'Outfit', sans-serif);
    overflow-x: hidden;
    box-sizing: border-box;
}

.login-page {
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.login-card {
    background: white;
    border-radius: var(--radius-md, 10px);
    padding: 2.5rem 2rem;
    box-shadow: 0 2px 8px rgba(24, 86, 108, 0.08);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Back button */
.login-back-btn {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #745d4a);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.login-back-btn:hover {
    color: var(--primary, #18566c);
    background: var(--primary-soft, #eef4f6);
}

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

.login-logo-link {
    display: inline-block;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md, 10px);
    object-fit: cover;
    display: block;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark, #303030);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted, #745d4a);
}

/* Alert */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-alert--error {
    color: #b91c1c;
}

/* Steps */
.login-step {
    display: none;
}

.login-step.active {
    display: block;
}

/* Phone input */
.login-phone-wrap {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.login-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--primary-soft, #eef4f6);
    border: 1px solid var(--border-color, #ece2cc);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-dark, #303030);
    min-width: 70px;
    font-size: 0.95rem;
}

.login-phone-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color, #ece2cc);
    border-radius: 8px;
    font-family: inherit;
    color: var(--text-dark, #303030);
    outline: none;
    transition: border-color 0.2s;
}

.login-phone-input:focus {
    border-color: var(--primary, #18566c);
    box-shadow: 0 0 0 3px rgba(24, 86, 108, 0.1);
}

/* Tabs */
.login-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color, #ece2cc);
    margin-bottom: 1.5rem;
}

.login-tab {
    flex: 1;
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #745d4a);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: none;
    background: none;
}

.login-tab:hover {
    color: var(--primary, #18566c);
}

.login-tab.active {
    color: var(--primary, #18566c);
}

.login-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary, #18566c);
}

/* Email Form */
.login-email-form {
    display: none;
}

.login-email-form.active {
    display: block;
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark, #303030);
    margin-bottom: 0.5rem;
}

.login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color, #ece2cc);
    border-radius: 8px;
    font-family: inherit;
    color: var(--text-dark, #303030);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: var(--primary, #18566c);
    box-shadow: 0 0 0 3px rgba(24, 86, 108, 0.1);
}

.login-forget-link {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--primary, #18566c);
    text-decoration: none;
    margin-top: -0.5rem;
    margin-bottom: 1.25rem;
}

.login-forget-link:hover {
    text-decoration: underline;
}

/* Field error */
.login-field-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.login-field-error.show {
    display: block;
}

/* Checkbox */
.login-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted, #745d4a);
    margin: 1.25rem 0;
    cursor: pointer;
    flex-wrap: wrap;
}

.login-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-top: 2px;
}

.login-checkbox a {
    color: var(--primary, #18566c);
    text-decoration: underline;
}

/* OTP Info */
.login-otp-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted, #745d4a);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.login-otp-info strong {
    display: block;
    color: var(--text-dark, #303030);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* WhatsApp button */
.login-whatsapp {
    display: inline-block;
    width: 100%;
    padding: 0.6rem;
    background: #25d366;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    transition: background 0.2s;
}

.login-whatsapp:hover {
    background: #1a9d50;
}

/* OTP boxes */
.login-otp-wrap {
    position: relative;
    margin: 1.5rem 0;
}

.login-otp-boxes {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.login-otp-digit {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    line-height: 50px;
    border: 1px solid var(--border-color, #ece2cc);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    pointer-events: none;
}

.login-otp-digit.active {
    border-color: var(--primary, #18566c);
    box-shadow: 0 0 0 3px rgba(24, 86, 108, 0.1);
}

/* Real hidden input — covers entire box area */
.login-otp-real {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    font-size: 16px;
    /* prevent iOS zoom */
}

/* Buttons */
.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary, #18566c);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover:not(:disabled) {
    background: var(--primary-dark, #0f3a4a);
}

.login-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-btn-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.login-btn-secondary {
    flex: 1;
    padding: 0.85rem;
    background: transparent;
    color: var(--primary, #18566c);
    border: 1px solid var(--border-color, #ece2cc);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn-secondary:hover {
    background: var(--primary-soft, #eef4f6);
}

/* Loading */
.login-loading {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted, #745d4a);
    margin-top: 1rem;
}

/* Footer */
.login-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted, #745d4a);
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--primary, #18566c);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 600px) {
    body.auth-body {
        padding: 1rem 0.75rem;
        justify-content: flex-start;
        /* Start from top on mobile */
        min-height: 100vh;
    }

    .login-page {
        margin: 0;
    }

    .login-card {
        padding: 1.5rem 1rem;
        border-radius: 8px;
    }

    .login-title {
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }

    .login-logo {
        width: 70px;
        height: 70px;
    }

    .login-otp-boxes {
        gap: 0.4rem;
    }

    .login-otp-digit {
        width: 42px;
        height: 42px;
        line-height: 42px;
        font-size: 1.2rem;
    }
}

/* Extra small screens fix (320px - 360px) */
@media (max-width: 360px) {
    .login-card {
        padding: 1.25rem 0.75rem;
    }

    .login-otp-boxes {
        gap: 0.25rem;
    }

    .login-otp-digit {
        width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 1.1rem;
    }

    .login-logo {
        width: 60px;
        height: 60px;
    }

    .login-phone-prefix {
        min-width: 60px;
        padding: 0 0.5rem;
    }
}