@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 500; font-display: swap; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 700; font-display: swap; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); }

:root {
    --primary: #2f5d8a;
    --text: #1f2430;
    --muted: #667085;
    --line: #e4e7ec;
    --surface: #ffffff;
    --page: #f6f7f9;
    --danger: #b42318;
    --radius: 10px;
}

@media (prefers-color-scheme: dark) {
    :root { --text: #eceef2; --muted: #a3acba; --line: #333a45; --surface: #1d2129; --page: #14171c; --danger: #ff8a80; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.9;
    color: var(--text);
    background: var(--page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.6; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }

/* Buttons */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 0 20px; border: 1px solid var(--primary); border-radius: var(--radius);
    background: var(--primary); color: #fff; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
    position: relative; overflow: hidden;
}
.button:hover { text-decoration: none; filter: brightness(1.07); }
.button:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.button--small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.button--block { width: 100%; }
.button--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.inline-form { display: inline; }

/* Countdown shown inside the resend button */
.button--timer::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: var(--progress, 0%);
    background: rgba(255, 255, 255, .22); transition: width 1s linear;
}
.button--timer > span { position: relative; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.site-header__brand { font-weight: 700; font-size: 17px; color: var(--text); }
.site-header__nav { display: flex; gap: 18px; flex: 1; }
.site-header__nav a { color: var(--text); }
.site-header__user { display: flex; align-items: center; gap: 16px; font-size: 14px; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 28px 0 16px; font-size: 14px; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer p { margin: 2px 0; color: var(--muted); }
.site-footer__phone { text-align: right; }
.site-footer__social { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
.site-footer__note { margin-top: 16px; text-align: center; }

/* Home and error pages */
.hero { padding: 72px 0; text-align: center; }
.hero h1 { font-size: 32px; }
.hero p { color: var(--muted); max-width: 640px; margin: 12px auto 0; }
.error-page { text-align: center; padding: 96px 16px; }
.error-page__status { font-size: 64px; font-weight: 700; color: var(--primary); margin: 0; line-height: 1.2; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.account { padding-top: 32px; padding-bottom: 48px; }
.details { display: grid; grid-template-columns: 110px 1fr; gap: 6px 16px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; }
.sessions { list-style: none; margin: 0 0 16px; padding: 0; }
.sessions li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sessions small { display: block; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; padding: 0 8px; border-radius: 999px; background: var(--primary); color: #fff; margin-inline-start: 6px; }

/* Sign-in */
.page-auth { background: var(--page); }
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth__brand { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 24px; }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; position: relative; }
.auth__hint { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.auth__back { position: absolute; top: 18px; inset-inline-start: 18px; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text); }
.auth__step h1 { padding-inline-start: 0; }
.auth__back + h1 { margin-top: 28px; }
.auth__error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-radius: 8px; padding: 8px 12px; margin: 0 0 16px; font-size: 14px; }
.auth__debug { background: #fff7d6; color: #6b4e00; border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.auth__divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__links { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; }
.auth__terms { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }

.field { display: block; margin-bottom: 16px; }
.field__label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .captcha input {
    width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font: inherit; font-size: 16px;
}
.field input:focus, .captcha input:focus, .code-boxes input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.field__group { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.field__group:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
.field__group input { border: 0; outline: 0 !important; border-radius: 0; letter-spacing: 1px; }
.field__prefix { display: flex; align-items: center; padding: 0 14px; border-inline-end: 1px solid var(--line); color: var(--muted); }

.code-boxes { display: flex; justify-content: center; gap: 10px; margin: 0 0 18px; }
.code-boxes input {
    width: 52px; height: 58px; text-align: center; font: inherit; font-size: 22px; font-weight: 700;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
}

.captcha { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-bottom: 16px; }
.captcha img { border-radius: 8px; border: 1px solid var(--line); }
.captcha input { grid-column: 1 / -1; }

@media (max-width: 480px) {
    .auth { justify-content: flex-end; padding: 0; }
    .auth__brand { margin: 24px 0; }
    .auth__card { max-width: none; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: 36px; }
    .code-boxes input { width: 46px; height: 54px; }
    .site-header__nav { display: none; }
    .site-header__inner { justify-content: space-between; }
}

/* Content pages */
.article { padding-top: 40px; padding-bottom: 56px; max-width: 780px; }
.article h1 { font-size: 30px; margin-bottom: 20px; }
.article__body { font-size: 16px; line-height: 2.1; overflow-wrap: break-word; }
.article__body img, .article__body iframe { max-width: 100%; height: auto; border-radius: var(--radius); }
.article__body iframe { aspect-ratio: 16 / 9; width: 100%; border: 0; }
.article__body table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.article__body th, .article__body td { border: 1px solid var(--line); padding: 8px 12px; text-align: right; }
.article__body blockquote { margin: 16px 0; padding: 4px 16px; border-inline-start: 4px solid var(--primary); color: var(--muted); }
.article__children { margin-top: 32px; padding: 16px 20px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.breadcrumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.site-header__nav a.is-active { color: var(--primary); font-weight: 700; }

/* Frequently asked questions */
.faq { margin-top: 32px; }
.faq__item { border: 1px solid var(--border, #e3e6ec); border-radius: 10px; padding: 12px 16px; margin-top: 8px; }
.faq__item summary { cursor: pointer; font-weight: 600; }
.faq__item p { margin: 10px 0 0; }

/* Contact form (shown by the contact-form module) */
.contact-form { display: grid; gap: 14px; max-width: 560px; margin-top: 28px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.contact-form input, .contact-form textarea { font: inherit; padding: 11px 14px; border: 1px solid var(--border, #d7dce6); border-radius: 10px; background: #fff; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--primary, #2f5bea); border-color: transparent; }
.contact-form__trap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__ok { background: #ecfdf3; color: #1a7f4b; border-radius: 10px; padding: 12px 16px; margin: 0; }
.contact-form__error { background: #fff4f2; color: #b42318; border-radius: 10px; padding: 12px 16px; margin: 0; }
.site-header__brand img { display: block; height: 40px; width: auto; }

/* Account page */
.account-form { margin-top: 16px; display: grid; gap: 4px; max-width: 520px; }
.account-form select, .account-form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.field--check { display: flex; align-items: center; gap: 8px; }
.field--check .field__label { margin: 0; }
.notice { background: color-mix(in srgb, var(--primary) 10%, transparent); border-radius: 8px; padding: 10px 14px; }
.notice--ok { background: color-mix(in srgb, #1f7a4d 12%, transparent); color: #1f7a4d; }
.recovery-codes { columns: 2; font-family: Consolas, monospace; }
[data-two-factor] .button { margin: 4px 0 4px 8px; }
.site-bell { position: relative; text-decoration: none; }
.notifications { list-style: none; margin: 0 0 12px; padding: 0; }
.notifications li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.notifications li.is-unread { border-inline-start: 3px solid var(--primary); padding-inline-start: 10px; }
.notifications li span, .notifications li time { color: var(--muted); font-size: 13px; }

/* Account tabs */
.account .tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.account .tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.account .tabs button.is-active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.account .tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.notice--strong { border-inline-start: 4px solid var(--primary); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.method { display: grid; gap: 2px; text-align: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); cursor: pointer; }
.method span { color: var(--muted); font-size: 13px; }
.method.is-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.setup-steps { padding-inline-start: 20px; margin: 0 0 8px; }
.setup-steps li { margin: 0 0 14px; }
.qr { display: block; margin: 10px 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.manual summary { cursor: pointer; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .methods { grid-template-columns: 1fr; } }

/* Header bell dropdown */
.bell { position: relative; }
.bell__panel { position: absolute; top: calc(100% + 10px); inset-inline-end: -8px; width: min(340px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.35); z-index: 40; overflow: hidden; }
.bell__panel header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell__panel ul { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.bell__panel li.muted { padding: 14px; }
.bell__panel li button { display: grid; gap: 2px; width: 100%; padding: 10px 14px; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--text); cursor: pointer; }
.bell__panel li button:hover { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.bell__panel li.is-unread button { border-inline-start: 3px solid var(--primary); }
.bell__panel li span, .bell__panel li time { color: var(--muted); font-size: 12px; }
.bell__all { display: block; padding: 10px 14px; text-align: center; font-size: 13px; }

.auth__powered { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; font-size: 12px; color: var(--muted); text-decoration: none; }
.auth__powered:hover { color: var(--text); }
