/* ========== SMS AUTH TEMPLATE ========== */

.auth-page {
    min-height: calc(100vh - 160px);
    padding: clamp(32px, 6vw, 72px) 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark theme */
.auth-page {
    background: #070b12;
    color: #f8fafc;
}

.auth-card {
    background: #111827;
    border-color: #263247;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.auth-logo {
    background: #0b111c;
}

.auth-title,
.auth-field > span:first-child,
.auth-footer a {
    color: #f8fafc;
}

.auth-desc,
.auth-footer,
.resend-text,
.timer {
    color: #a7b4c8;
}

.input-wrapper input {
    background: #0b111c;
    border-color: #263247;
    color: #f8fafc;
}

.input-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

.auth-submit {
    background: #2563eb;
    color: #fff;
}

.auth-submit:hover {
    background: #1d4ed8;
}

.auth-shell {
    width: min(100%, 440px);
}

.auth-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 20px;
    padding: clamp(22px, 5vw, 34px);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: #f8fafc;
}

.auth-logo img,
.auth-logo .custom-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.auth-title {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.45rem;
    font-weight: 850;
}

.auth-desc {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.8;
}

.auth-notice {
    display: none;
    margin-bottom: 16px;
    padding: 11px 13px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.84rem;
    line-height: 1.7;
}

.auth-notice.show {
    display: block;
}

.auth-notice.error {
    background: #fef2f2;
    color: #dc2626;
}

.auth-step {
    display: none;
}

.auth-step.is-active {
    display: block;
    animation: authFade 0.22s ease;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field > span:first-child {
    color: #334155;
    font-size: 0.86rem;
    font-weight: 750;
}

.input-wrapper {
    position: relative;
    display: block;
}

.input-wrapper i {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: #94a3b8;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 42px 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    direction: ltr;
    text-align: right;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-wrapper input.error {
    border-color: #dc2626;
}

.form-error {
    display: none;
    color: #dc2626;
    font-size: 0.76rem;
}

.form-error.show {
    display: block;
}

.auth-submit {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 14px;
    background: #0f172a;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s ease;
}

.auth-submit:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.auth-submit:disabled,
.resend-btn:disabled,
.change-mobile-btn:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    transform: none;
}

.otp-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8rem;
}

.resend-btn,
.change-mobile-btn {
    border: 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 750;
    padding: 0;
}

.auth-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 700;
}

.auth-loading[hidden],
.auth-step[hidden] {
    display: none !important;
}

.auth-loading i {
    color: #2563eb;
    font-size: 1.8rem;
}

.auth-footer {
    margin: 16px 0 0;
    color: #64748b;
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.8;
}

@keyframes authFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .auth-page {
        align-items: flex-start;
        padding-top: 28px;
    }

    .otp-info {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Dark theme final pass */
.auth-page { background: #070b12; color: #f8fafc; }
.auth-card { background: #111827; border-color: #263247; box-shadow: 0 24px 70px rgba(0, 0, 0, .34); }
.auth-logo { background: #0b111c; }
.auth-title,
.auth-field > span:first-child,
.auth-footer a { color: #f8fafc; }
.auth-desc,
.auth-footer,
.resend-text,
.timer { color: #a7b4c8; }
.input-wrapper input { background: #0b111c; border-color: #263247; color: #f8fafc; }
.input-wrapper input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, .18); }
.auth-loading { background: rgba(17, 24, 39, .88); color: #f8fafc; }
.auth-submit { background: #2563eb; color: #fff; }
.auth-submit:hover { background: #1d4ed8; }
