.page-hero { position: relative; padding: 72px 0 52px; overflow-x: clip; isolation: isolate; text-align: center; }
.page-hero--compact { padding-bottom: 36px; }
.page-hero__title { margin-top: 12px; font-size: clamp(32px, 4.8vw, 58px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.page-hero__title span { display: block; }
html[dir="rtl"] .page-hero__title { line-height: 1.4; }
.page-hero__lede { margin: 20px auto 0; max-width: 62ch; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); }

.timeline { list-style: none; padding: 0; margin: 0 auto; max-width: 820px; position: relative; display: grid; gap: 14px; }
.timeline::before {
  content: ""; position: absolute; inset-block: 24px; inset-inline-start: 21px; width: 2px; opacity: .35;
  background: linear-gradient(var(--accent), var(--ai));
}
.timeline li { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; align-items: start; }
.timeline__n {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; font-size: 18px;
  color: var(--on-grad); background: var(--btn-grad); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.timeline .card { padding: 22px 26px; }
.timeline .card h3 { margin-bottom: 6px; }

.about-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; align-items: start; }
.h2 { margin: 8px 0 22px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.25; font-weight: 700; }
html[dir="rtl"] .h2 { line-height: 1.45; }
.tech, .data-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.tech li, .data-list > div {
  display: grid; gap: 2px; padding: 16px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.tech b, .data-list dt { font-weight: 700; font-size: 16px; }
.tech span, .data-list dd { color: var(--muted); font-size: 14.5px; }
.cta__row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; height: 52px; padding: 0 16px; font: inherit; font-size: 15.5px; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { height: auto; min-height: 150px; padding: 14px 16px; line-height: 1.7; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--bad); }
.field__err, .card .field__err { font-size: 13px; color: var(--bad); }
.field__meta, .card .field__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); min-height: 1.4em; }
.count { margin-inline-start: auto; }
.help, .card .help { font-size: 12.5px; color: var(--muted); }
.card .help--center { text-align: center; }
.form-error, .card .form-error {
  padding: 12px 16px; border-radius: 14px; font-size: 14px; color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
}
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.field__pw { position: relative; }
/* A password is always typed left to right (the input has dir="ltr"), so the eye button is always on the right, whatever the page language.
   With logical properties it jumped to the left in Persian and Arabic and sat on top of the first characters. */
.field__pw input { padding-right: 52px; }
.field__toggle { position: absolute; inset-block: 0; right: 6px; left: auto; width: 42px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; }
.field__toggle:hover { color: var(--text); }
.field__toggle .eye-off, .field__toggle[aria-pressed="true"] .eye { display: none; }
.field__toggle[aria-pressed="true"] .eye-off { display: block; }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 2px; }
.strength i { height: 5px; border-radius: 3px; background: var(--border); transition: background .25s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--bad); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] i:nth-child(-n+3), .strength[data-level="4"] i { background: var(--ok); }

.contact { padding-top: 8px; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
.form-card { padding: clamp(24px, 4vw, 38px); }
.contact__side { display: grid; gap: 16px; }
.contact__side .card { padding: 24px; }
.contact__side .ico { margin-bottom: 14px; }
.done { text-align: center; padding: 28px 8px; display: grid; justify-items: center; gap: 10px; }
.done__ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.done__ico .i { width: 32px; height: 32px; stroke-width: 2.2; }
.done h2 { font-size: 26px; font-weight: 800; }
.done p { color: var(--muted); max-width: 40ch; margin-bottom: 8px; }

.auth { position: relative; isolation: isolate; overflow-x: clip; padding: 44px 0 84px; }
.auth__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: stretch; max-width: 1060px; }
.auth__card { padding: clamp(26px, 4vw, 46px); display: flex; flex-direction: column; justify-content: center; }
.auth__card:hover { transform: none; }
.auth__card h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.25; font-weight: 800; }
.auth__sub { margin-top: 6px; color: var(--muted); }
.auth__card .form { margin-top: 26px; }
.auth__alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 14.5px; }

.auth__aside {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: clamp(26px, 4vw, 46px); border-radius: 26px; border: 1px solid var(--border);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--ai) 20%, var(--surface)));
}
.aside__mol { direction: ltr; width: min(300px, 80%); align-self: center; margin-block: 24px; fill: none; stroke: var(--text); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.aside__mol .ring { stroke: var(--accent); stroke-width: 2.2; }
.aside__copy h2 { font-size: 26px; font-weight: 800; }
.aside__copy p { margin-top: 6px; color: var(--muted); }
.aside__copy ul { list-style: none; padding: 0; margin-top: 18px; display: grid; gap: 10px; }
.aside__copy li { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.aside__copy li .i { width: 20px; height: 20px; color: var(--ok); stroke-width: 2.4; }

@media (max-width: 900px) {
  .about-two, .contact__grid, .auth__grid { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .page-hero { padding-top: 48px; }
}
@media (max-width: 640px) {
  .form__row { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
  .timeline__n { width: 36px; height: 36px; font-size: 15px; }
  .timeline::before { inset-inline-start: 17px; }
  .timeline .card { padding: 18px 20px; }
  .auth { padding-top: 24px; }
}

.google-btn { margin-top: 24px; gap: 12px; background: var(--surface); }
.google-btn .g-logo { width: 22px; height: 22px; flex: none; }
.auth__or { display: flex; align-items: center; gap: 14px; margin: 20px 0 -6px; color: var(--muted); font-size: 13.5px; }
.auth__or::before, .auth__or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
html[data-google="0"] .google-btn, html[data-google="0"] .auth__or { display: none; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; overflow: visible; display: flex; flex-direction: column; gap: 6px; padding: clamp(24px, 3vw, 34px); }
.plan:hover { transform: none; }
.plan--feat { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--btn-grad) border-box; }
.plan.is-current { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.plan__badge {
  position: absolute; inset-block-start: 18px; inset-inline-end: 18px; padding: 2px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--on-grad); background: var(--btn-grad);
}
.plan__name { font-size: 26px; font-weight: 800; }
.plan__for { color: var(--muted); font-size: 15px; }
.plan__amount { margin-top: 14px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.plan__amount b { font-size: 52px; line-height: 1; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.plan__list { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 11px; flex: 1; }
.plan__list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; }
.plan__list .i { color: var(--ok); stroke-width: 2.4; margin-top: 3px; }
.plans__manual { margin: 22px auto 0; max-width: 70ch; text-align: center; color: var(--muted); font-size: 14.5px; }

.matrix-wrap { overflow-x: auto; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); }
.matrix { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.matrix th, .matrix td { padding: 15px 20px; text-align: center; border-bottom: 1px solid var(--border); }
.matrix thead th { font-size: 16px; font-weight: 800; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.matrix tbody th { text-align: start; font-weight: 600; }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix td.yes { color: var(--ok); font-weight: 600; }
.matrix td.no { color: var(--muted); }
.matrix td[data-plan-credits] { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.matrix-note { margin: 22px auto 0; max-width: 70ch; text-align: center; font-weight: 600; }

.costs { list-style: none; padding: 0; margin: 0 auto; max-width: 820px; display: grid; gap: 10px; }
.costs li { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.costs small { color: var(--muted); }
.costs b { flex: none; min-width: 44px; padding: 3px 14px; border-radius: 999px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--on-grad); background: var(--btn-grad); }
.rules .card { padding: 22px 24px; }
.rules h3 { margin-bottom: 4px; }

.billing { display: flex; width: fit-content; margin: 0 auto 26px; padding: 5px; gap: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.billing__opt { height: 40px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--muted); transition: background .2s, color .2s; }
.billing__opt small { margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.billing__opt.is-on { color: var(--on-grad); background: var(--btn-grad); }
.billing__opt.is-on small { color: inherit; background: color-mix(in srgb, var(--on-grad) 22%, transparent); }
.plan__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 6px; color: var(--muted); }
.plan__price b { font-size: 24px; font-weight: 800; color: var(--text); }
.plan__billed { flex-basis: 100%; color: var(--ok); font-size: 13px; }
.plan__flag {
  position: absolute; inset-block-start: -13px; inset-inline-start: 50%; transform: translateX(-50%); padding: 3px 16px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 800; color: var(--on-grad); background: var(--btn-grad); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
html[dir="rtl"] .plan__flag { transform: translateX(50%); }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 820px; margin: 0 auto; }
.pack { padding: 24px; text-align: center; display: grid; gap: 4px; }
.pack:hover { transform: none; }
.pack__n { color: var(--muted); }
.pack__n b { font-size: 36px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.pack__price { font-size: 22px; font-weight: 700; }
.pack small { color: var(--muted); }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.account-grid .card { padding: clamp(24px, 3vw, 34px); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.account-grid .card:hover { transform: none; }
.balance__label { color: var(--muted); font-size: 14px; font-weight: 600; }
.balance__n { display: flex; align-items: baseline; gap: 10px; color: var(--muted); }
.balance__n b { font-size: 64px; line-height: 1; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.balance[data-level="low"] .balance__n b { color: var(--warn); }
.balance[data-level="empty"] .balance__n b { color: var(--bad); }
.balance__parts { display: grid; gap: 6px; width: 100%; margin: 6px 0 10px; }
.balance__parts > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 15px; }
.balance__parts dt { color: var(--muted); }
.balance__parts dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.planbox__name { font-size: 32px; font-weight: 800; }
.alert-box { margin-bottom: 18px; padding: 14px 20px; border-radius: 16px; font-weight: 600; border: 1px solid; }
.alert-box[data-level="warn"] { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.alert-box[data-level="bad"] { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }

.ledger-wrap { overflow-x: auto; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); }
.ledger { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14.5px; }
.ledger th, .ledger td { padding: 12px 18px; text-align: start; border-bottom: 1px solid var(--border); }
.ledger thead th { font-size: 13px; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.ledger tbody tr:last-child > * { border-bottom: 0; }
.ledger .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger__grant td:nth-child(3), .ledger__purchase td:nth-child(3) { color: var(--ok); font-weight: 700; }
.ledger__spend td:nth-child(3), .ledger__expire td:nth-child(3), .ledger__pending td:nth-child(3) { color: var(--bad); font-weight: 700; }
.ledger__pending td, .ledger__refund td { color: var(--muted); }
.ledger .tag { padding: 2px 10px; border-radius: 999px; font-size: 12.5px; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.ledger-empty { padding: 28px; text-align: center; color: var(--muted); }

@media (max-width: 640px) { .packs { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .plans, .account-grid { grid-template-columns: 1fr; }
  .plan--feat { margin-top: 12px; }
}
