/* ==========================================================================
   Mealio — صفحات احراز هویت (ورود، ثبت‌نام، فراموشی رمز)
   ========================================================================== */

:root {
    --auth-ink: #10192a;
    --auth-ink-soft: #4a5a70;
    --auth-muted: #8b98a5;
    --auth-line: #e6ebf2;
    --auth-bg: #f5f7fb;
    --auth-brand: #ff6b35;
    --auth-brand-2: #f7451f;
    --auth-accent: #12b886;
}

* { box-sizing: border-box; }

.auth-body {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    font-family: 'IRANYekan', 'IRANYekanX', Tahoma, sans-serif;
    color: var(--auth-ink);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* ==================== ستون برند ==================== */
.auth-brand {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #1b2438 0%, #16233d 45%, #0f1a30 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 48px 56px;
}

.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
}

.auth-brand::before {
    width: 380px; height: 380px;
    background: #ff6b35;
    top: -120px; left: -90px;
}

.auth-brand::after {
    width: 320px; height: 320px;
    background: #3b5bdb;
    bottom: -110px; right: -80px;
}

.auth-brand-inner { position: relative; z-index: 1; max-width: 460px; }

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 44px;
}

.auth-logo-mark {
    width: 42px; height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--auth-brand), var(--auth-brand-2));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 8px 22px rgba(255, 107, 53, .4);
}

.auth-logo-text { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; }

.auth-brand-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.55;
    margin: 0 0 18px;
}

.auth-brand-title span {
    background: linear-gradient(120deg, #ffb27a, #ff6b35);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-brand-desc {
    font-size: .93rem;
    line-height: 2.1;
    color: rgba(255, 255, 255, .74);
    margin: 0 0 32px;
}

.auth-brand-list {
    list-style: none;
    padding: 0;
    margin: 0 0 44px;
}

.auth-brand-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .88rem;
    color: rgba(255, 255, 255, .9);
    padding: 9px 0;
}

.auth-brand-list i { color: var(--auth-accent); font-size: .95rem; }

.auth-brand-foot { border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 22px; }

.auth-avatars { display: flex; margin-bottom: 10px; }

.auth-avatars span {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b5bdb, #5f3dc4);
    border: 2px solid #16233d;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700;
    margin-left: -10px;
}

.auth-avatars span:last-child { background: rgba(255, 255, 255, .16); }

.auth-brand-foot p {
    margin: 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .6);
}

/* ==================== ستون فرم ==================== */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 22px;
    padding: 32px 32px 28px;
    box-shadow: 0 24px 60px rgba(16, 25, 42, .09);
    border: 1px solid var(--auth-line);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    color: var(--auth-muted);
    text-decoration: none;
    margin-bottom: 22px;
    transition: color .18s;
}

.auth-back:hover { color: var(--auth-brand); }

/* مراحل ثبت‌نام */
.auth-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .76rem;
    color: var(--auth-muted);
    font-weight: 600;
}

.auth-step b {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #eef1f6;
    color: var(--auth-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
}

.auth-step.done b { background: var(--auth-accent); color: #fff; }
.auth-step.active { color: var(--auth-ink); }
.auth-step.active b { background: var(--auth-brand); color: #fff; }

.auth-step-line {
    flex: 1;
    height: 2px;
    border-radius: 2px;
    background: #eef1f6;
}

.auth-step-line.done { background: var(--auth-accent); }

.auth-head { margin-bottom: 24px; }

.auth-head h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--auth-ink);
}

.auth-head p {
    margin: 0;
    font-size: .85rem;
    line-height: 2;
    color: var(--auth-ink-soft);
}

/* ==================== فرم ==================== */
.auth-field { margin-bottom: 18px; }

.auth-field > label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--auth-ink);
    margin-bottom: 8px;
}

.auth-input-wrap { position: relative; display: flex; align-items: center; }

.auth-input-wrap > i.field-icon {
    position: absolute;
    right: 14px;
    color: #b6c0cc;
    font-size: .9rem;
    pointer-events: none;
    transition: color .18s;
}

.auth-input {
    width: 100%;
    border: 1.6px solid var(--auth-line);
    background: #fbfcfe;
    border-radius: 13px;
    padding: 13px 42px 13px 14px;
    font-size: .92rem;
    font-family: inherit;
    color: var(--auth-ink);
    transition: border-color .18s, background .18s, box-shadow .18s;
    outline: none;
}

.auth-input::placeholder { color: #b6c0cc; font-size: .85rem; }

.auth-input:focus {
    border-color: var(--auth-brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, .1);
}

.auth-input-wrap:focus-within > i.field-icon { color: var(--auth-brand); }

.auth-input.is-invalid { border-color: #e74c3c; }

/* دکمه نمایش رمز */
.auth-eye {
    position: absolute;
    left: 12px;
    background: none;
    border: 0;
    color: #b6c0cc;
    cursor: pointer;
    padding: 4px;
    font-size: .88rem;
    transition: color .18s;
}

.auth-eye:hover { color: var(--auth-ink-soft); }

/* فیلد کد تأیید */
.auth-code-input {
    width: 100%;
    border: 1.8px solid var(--auth-line);
    background: #fbfcfe;
    border-radius: 14px;
    padding: 16px;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 14px;
    text-align: center;
    font-family: inherit;
    color: var(--auth-ink);
    direction: ltr;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.auth-code-input:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, .1);
}

/* دکمه اصلی */
.auth-btn {
    width: 100%;
    border: 0;
    border-radius: 13px;
    padding: 14px;
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-brand), var(--auth-brand-2));
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(255, 107, 53, .3);
    transition: transform .16s, box-shadow .16s, opacity .16s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(255, 107, 53, .36); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.auth-btn-ghost {
    background: #fff;
    color: var(--auth-ink);
    border: 1.6px solid var(--auth-line);
    box-shadow: none;
}

.auth-btn-ghost:hover { border-color: #cfd8e3; box-shadow: none; }

/* پیام‌های خطا */
.auth-validation {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    background: #fff5f5;
    border: 1px solid #ffd9d9;
    border-radius: 12px;
    padding: 12px 14px;
}

.auth-validation li {
    font-size: .8rem;
    color: #c0392b;
    line-height: 1.9;
    display: flex;
    gap: 7px;
}

.auth-validation li::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Pro';
    font-weight: 900;
}

.field-validation-error {
    display: block;
    font-size: .76rem;
    color: #e74c3c;
    margin-top: 6px;
}

/* ردیف کمکی */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    font-size: .82rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-ink-soft);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 17px; height: 17px;
    accent-color: var(--auth-brand);
    cursor: pointer;
}

.auth-link {
    color: var(--auth-brand);
    text-decoration: none;
    font-weight: 600;
    font-size: .82rem;
}

.auth-link:hover { text-decoration: underline; }

.auth-foot {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-line);
    text-align: center;
    font-size: .84rem;
    color: var(--auth-ink-soft);
}

.auth-foot a { color: var(--auth-brand); font-weight: 700; text-decoration: none; }

/* ارسال مجدد */
.auth-resend {
    text-align: center;
    margin-top: 16px;
    font-size: .82rem;
    color: var(--auth-muted);
}

.auth-resend button {
    background: none;
    border: 0;
    color: var(--auth-brand);
    font-weight: 700;
    font-family: inherit;
    font-size: .82rem;
    cursor: pointer;
    padding: 4px;
}

.auth-resend button:disabled { color: var(--auth-muted); cursor: not-allowed; }

.auth-hint {
    background: #f4f8ff;
    border: 1px solid #dbe8fb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .79rem;
    line-height: 2;
    color: #4a5a70;
    margin-bottom: 18px;
}

.auth-hint i { color: #3b5bdb; }

.auth-copyright {
    margin: 24px 0 0;
    font-size: .74rem;
    color: var(--auth-muted);
}

/* ==================== ریسپانسیو ==================== */
@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr; }

    .auth-brand {
        padding: 34px 26px;
        min-height: auto;
    }

    .auth-brand-inner { max-width: 100%; }
    .auth-logo { margin-bottom: 22px; }
    .auth-brand-title { font-size: 1.4rem; margin-bottom: 12px; }
    .auth-brand-desc { margin-bottom: 20px; font-size: .86rem; line-height: 1.95; }
    .auth-brand-list { display: none; }
    .auth-brand-foot { display: none; }

    .auth-main { padding: 24px 16px 40px; }

    .auth-card {
        border-radius: 20px;
        padding: 24px 20px;
        box-shadow: 0 16px 40px rgba(16, 25, 42, .08);
    }
}

@media (max-width: 480px) {
    .auth-head h2 { font-size: 1.2rem; }
    .auth-input { padding: 12px 40px 12px 12px; font-size: .88rem; }
    .auth-code-input { font-size: 1.45rem; letter-spacing: 10px; padding: 14px; }
}
