/* account.css — صفحه‌های ورود/ثبت‌نام (سبک: بدون انیمیشن سنگین، بدون بلور، بدون بوت‌استرپ)
   بعد از style.css ، ui.css و site.css لود میشه */

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px 14px;
}

.auth-wrap {
    display: block;
    width: 100%;
    max-width: 440px;
}

/* ===== کارت ===== */
.auth-card {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.auth-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--purple), var(--purple-deep) 60%, #b9a4f2);
}

.auth-header {
    position: relative;
    isolation: isolate;
    padding: 22px 20px 4px;
    text-align: center;
}

.auth-header::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 100px;
    background: radial-gradient(ellipse 70% 100% at 50% 0%, var(--purple-soft), transparent 80%);
    z-index: -1;
}

.auth-logo {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    padding: 8px;
    background: #fff;
    border: 1px solid #d9ccff;
    border-radius: 16px;
    box-shadow: 0 0 0 4px var(--purple-soft);
}

.auth-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.auth-header p {
    margin-top: 2px;
    font-size: .78rem;
    color: var(--text-3);
}

.auth-body { padding: 18px 20px 22px; }

/* ===== پیام‌ها ===== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: .8rem;
    line-height: 1.8;
    border: 1px solid;
    border-radius: 12px;
}

.alert svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 4px; }
.alert span { flex: 1; min-width: 0; }

.alert-success { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.alert-danger,
.alert-error   { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.alert-warning { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.alert-info    { color: var(--purple-deep); background: var(--purple-soft); border-color: #d9ccff; }

.alert-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-inline-start: auto;
    font-family: inherit;
    font-size: 1.1rem;
    line-height: 1;
    color: inherit;
    background: rgba(255, 255, 255, .6);
    border: 1px solid currentColor;
    border-radius: 8px;
    cursor: pointer;
    opacity: .7;
}

.alert-close:hover { opacity: 1; }

/* ===== فرم ===== */
.form-group { margin-bottom: 14px; }

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-2);
}

.form-label svg { width: 15px; height: 15px; color: var(--purple); }

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s;
}

.form-control::placeholder { color: var(--text-3); font-size: .85rem; }

.form-control:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

.form-control.is-invalid { border-color: #ef4444; }

.invalid-feedback {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    font-size: .72rem;
    line-height: 1.7;
    color: #dc2626;
}

.invalid-feedback svg { flex-shrink: 0; width: 14px; height: 14px; margin-top: 3px; }

.form-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    font-size: .7rem;
    line-height: 1.7;
    color: var(--text-3);
}

.form-text svg { flex-shrink: 0; width: 13px; height: 13px; margin-top: 3px; }

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

/* ===== رمز عبور ===== */
.input-group { display: flex; gap: 8px; }
.input-group .form-control { flex: 1; min-width: 0; }

.pw-toggle {
    flex-shrink: 0;
    width: 46px;
    display: grid;
    place-items: center;
    color: var(--purple-deep);
    background: var(--purple-soft);
    border: 1px solid var(--purple-deep);
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .eye-off { display: none; }
.pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: block; }
.pw-toggle:hover { color: #fff; background: var(--purple); }

.strength {
    height: 5px;
    margin-top: 8px;
    overflow: hidden;
    background: var(--line);
    border-radius: 5px;
}

.strength-bar {
    width: 0;
    height: 100%;
    transition: width .25s ease, background .25s;
}

.bar-weak   { background: #ef4444; }
.bar-mid    { background: #f59e0b; }
.bar-strong { background: #10b981; }

/* ===== قوانین ===== */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.form-check input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--purple);
}

.form-check label {
    font-size: .78rem;
    line-height: 1.7;
    color: var(--text-2);
}

.auth-inline-link { font-weight: 600; color: var(--purple-deep); }

/* ===== دکمه‌ی اصلی ===== */
.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    background: var(--purple);
    border: 1px solid var(--purple-deep);
    border-radius: 12px;
    box-shadow: 0 8px 18px -8px var(--purple-glow);
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.auth-submit svg { width: 18px; height: 18px; }
.auth-submit:hover { background: var(--purple-deep); }
.auth-submit:active { transform: scale(.99); }

.btn-loading { pointer-events: none; opacity: .75; }

.spin {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== فوتر ===== */
.auth-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    font-size: .78rem;
    color: var(--text-2);
    border-top: 1px solid var(--line);
}

.auth-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-weight: 600;
    color: var(--purple-deep);
    background: var(--purple-soft);
    border: 1px solid var(--purple-deep);
    border-radius: 10px;
    transition: background .2s, color .2s;
}

.auth-link svg { width: 15px; height: 15px; }
.auth-link:hover { color: #fff; background: var(--purple); }

.auth-link.subtle {
    font-weight: 500;
    font-size: .72rem;
    color: var(--text-2);
    background: #fff;
    border-color: var(--line-strong);
}

.auth-link.subtle:hover { color: var(--purple-deep); background: var(--purple-soft); border-color: var(--purple); }

@media (max-width: 420px) {
    .auth-body { padding: 16px 14px 20px; }
    .row-2 { grid-template-columns: 1fr; }
}


/* ==========================================================
   صفحه‌های بازیابی رمز (forgot / reset / success)
   ========================================================== */
.auth-hero {
    margin-bottom: 18px;
    text-align: center;
}

.auth-hero-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    border: 1px solid var(--purple-deep);
    border-radius: 18px;
    box-shadow: 0 10px 22px -8px var(--purple-glow), 0 0 0 5px var(--purple-soft);
}

.auth-hero-icon svg { width: 28px; height: 28px; }

.auth-hero-icon.success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #059669;
    box-shadow: 0 10px 22px -8px rgba(16, 185, 129, .35), 0 0 0 5px #d1fae5;
}

.auth-hero-title {
    margin-bottom: 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.auth-hero p {
    font-size: .8rem;
    line-height: 1.95;
    color: var(--text-2);
}

.auth-hero .alert { margin: 14px 0 0; text-align: right; }

.alert strong { font-weight: 700; }

.tips {
    margin: 6px 0 0;
    padding: 0 18px 0 0;
    font-size: .75rem;
    line-height: 1.9;
    color: var(--text-2);
}

/* لینک دکمه‌ای (مثلاً «ورود به حساب کاربری» در صفحه‌ی موفقیت) */
a.auth-submit { text-decoration: none; }

/* ==========================================================
   ویجت‌هایی که مستقیم از فرم جنگو رندر میشن ({{ form.phone }} و ...)
   حتی اگر class="form-control" نداشته باشن؛ با :where اولویتش صفره
   ========================================================== */
:where(.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])) {
    width: 100%;
    padding: 11px 14px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s;
}

:where(.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])):focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-glow);
}

:where(.form-group input)::placeholder { color: var(--text-3); font-size: .85rem; }

:where(.input-group input) { flex: 1; min-width: 0; }