/* The pages before sign-in (first-time setup, sign-in, forgotten password, two-step code):
   one card on the canvas under the madrasa's own name and logo. Built on qalam.css tokens. */
.door { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); box-sizing: border-box; background: var(--q-canvas); color: var(--q-ink); font-family: var(--q-font-sans); -webkit-font-smoothing: antialiased; }
.door-main { width: 100%; max-width: 420px; display: grid; gap: var(--q-space-5); }
.door-wide .door-main { max-width: 540px; }

.door-brand { display: grid; justify-items: center; gap: 2px; text-align: center; }
/* The madrasah first, at a size that reads: its mark writing itself (x-q.loader, once, as the page
   opens) at 112px, with its name as type beneath, English then Arabic, the way the logo sets them;
   else its logo 104px tall (a wide one keeps its shape, up to the card's width; margins were trimmed
   when it was uploaded); else its initials. On a plate, so a dark emblem reads in dark mode; the plate
   reaches 8px past its padding (a ring), so the emblem keeps a margin of about a ninth of the plate. */
.door-brand img, .door-brand .door-loader { margin-bottom: 20px; padding: 6px; border-radius: 22px; background: var(--q-plate); box-shadow: 0 0 0 8px var(--q-plate); }
.door-brand img.is-tile { background: none; box-shadow: none; } /* the initials made at setup: a tile of their own */
.door-brand img { height: 104px; width: auto; max-width: min(340px, 100%); object-fit: contain; }
.door-brand .door-loader { --q-loader-size: 112px; }
.door-mark { margin-bottom: 12px; width: 80px; height: 80px; border-radius: 19px; display: grid; place-items: center; background: var(--q-accent); color: var(--q-on-accent); font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.door-mark.is-long { font-size: 22px; }
.door-name { font-size: 22px; line-height: 28px; font-weight: 650; letter-spacing: -0.018em; text-wrap: balance; }
.door-name-ar { font-family: var(--q-font-arabic); font-size: 20px; line-height: 32px; font-weight: 600; color: var(--q-ink-secondary); }

.door-card { background: var(--q-surface); border-radius: var(--q-radius-xl); box-shadow: 0 0 0 1px var(--q-hairline), var(--q-shadow-control); padding: 28px 24px 24px; display: grid; gap: var(--q-space-5); }
@media (min-width: 480px) { .door-card { padding: 32px 32px 28px; } }
.door-head { display: grid; gap: 6px; }
.door-head h1 { margin: 0; font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; }
.door-head p { margin: 0; color: var(--q-ink-secondary); font-size: 15px; line-height: 21px; }
.door form { display: grid; gap: var(--q-space-4); }
.door-row { display: flex; align-items: center; justify-content: space-between; gap: var(--q-space-3); flex-wrap: wrap; }
.door-link { color: var(--q-accent); text-decoration: none; font-size: 15px; }
.door-link:hover { text-decoration: underline; }
.door-link-button { padding: 0; border: 0; background: none; font: inherit; font-size: 15px; cursor: pointer; }
.door-row form { display: contents; }
.door-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--q-space-3); margin-top: var(--q-space-2); }
.door-actions .q-btn-filled { margin-inline-start: auto; min-width: 140px; }
@media (max-width: 479px) { .door-actions { flex-direction: column-reverse; align-items: stretch; } .door-actions .q-btn { width: 100%; } }
.door-note { margin: 0; text-align: center; color: var(--q-ink-tertiary); font-size: 13px; line-height: 18px; }
.door-split { display: grid; gap: var(--q-space-4); align-items: start; }
@media (min-width: 480px) { .door-split { grid-template-columns: 1fr 1fr; } }

/* Setup: where you are (Step 2 of 4) */
.door-steps { display: grid; gap: 8px; }
.door-steps-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--q-ink-secondary); }
.door-steps-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.door-steps-bar span { height: 4px; border-radius: 2px; background: var(--q-fill-strong); }
.door-steps-bar span.is-done { background: var(--q-accent); }

/* Choice cards (the kind of year) */
.door-options { display: grid; gap: var(--q-space-3); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.door-option { position: relative; display: block; padding: 12px 14px; border-radius: var(--q-radius-md); box-shadow: inset 0 0 0 1px var(--q-hairline); cursor: pointer; }
.door-option input { position: absolute; opacity: 0; pointer-events: none; }
.door-option span { display: grid; gap: 2px; }
.door-option b { font-weight: 600; }
.door-option small { color: var(--q-ink-secondary); font-size: 13px; line-height: 18px; }
.door-option:has(input:checked) { box-shadow: inset 0 0 0 2px var(--q-accent); background: var(--q-accent-soft); }
.door-option:has(input:focus-visible) { outline: 2px solid var(--q-focus-ring); outline-offset: 2px; }

/* The licence this copy is activated with */
.door-licence { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--q-radius-md); background: var(--q-success-soft); color: var(--q-ink); font-size: 14px; line-height: 19px; }
.door-licence .q-icon { color: var(--q-success); flex: none; }
.door-licence b { font-weight: 600; }

.door-key { font-family: var(--q-font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.door-logo { display: flex; align-items: center; gap: var(--q-space-3); }
.door-logo img { width: 48px; height: 48px; border-radius: 11px; object-fit: contain; background: var(--q-fill); }

/* Ready */
.door-ready { text-align: center; justify-items: center; }
.door-ready-check { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--q-success-soft); color: var(--q-success); }
.door-ready-check .q-icon { width: 32px; height: 32px; }
.door-next { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; text-align: start; width: 100%; }
.door-next li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 21px; }
.door-next li .q-icon { color: var(--q-accent); flex: none; margin-top: 2px; }

.door .q-banner { margin: 0; }

/* The sign-in page's language switch (each language in its own name; the current one is plain text). */
.door .door-languages { display: flex; justify-content: center; gap: var(--q-space-1); margin-block-start: var(--q-space-5); }
.door-languages button { padding: 6px 12px; border: 0; border-radius: var(--q-radius-full, 999px); background: none; color: var(--q-accent); font: inherit; font-size: 15px; cursor: pointer; }
.door-languages button:hover:not(:disabled) { background: var(--q-fill); }
.door-languages button[aria-current] { color: var(--q-ink-secondary); cursor: default; }

/* The web installer (resources/views/install): its two steps, what the server lacks, the progress. */
.door-steps-bar.install-steps-2 { grid-template-columns: repeat(2, 1fr); }
.install-checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.install-checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 21px; }
.install-checks li .q-icon { color: var(--q-danger); flex: none; margin-top: 2px; }
.install-checks li.is-ok .q-icon { color: var(--q-success); }
.install-checks small { display: block; color: var(--q-ink-secondary); font-size: 13px; line-height: 18px; }
.install-ready { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 14px; line-height: 19px; color: var(--q-ink-secondary); }
.install-ready .q-icon { color: var(--q-success); flex: none; }
.install-progress { display: grid; gap: 10px; }
.install-progress .q-meter > span { width: 0; transition: width 0.4s ease; }
@media (prefers-reduced-motion: reduce) { .install-progress .q-meter > span { transition: none; } }
.install-status { margin: 0; font-size: 15px; line-height: 21px; color: var(--q-ink-secondary); font-variant-numeric: tabular-nums; }
.install-output { margin: 0; max-height: 160px; overflow: auto; padding: 10px 12px; border-radius: var(--q-radius-md); background: var(--q-fill); font-family: var(--q-font-mono); font-size: 12px; line-height: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.install-output:empty { display: none; }
