/* What: the create-account page (/register), shaped like the certificate it leads to: the emerald proof panel at the start (the
         title, the certificate's pearl side in small with the name filling in, what comes next, the way to sign in) and a pearl
         sheet beside it holding the form - named sections, 48 px fields, choice tiles, the photo window, one gold button.
         A workshop's registration (/w/{slug}/register, .signup.reg) is the same page with the workshop in the panel: its name,
         its dates, its sales tag, and the certificate naming it.
   Use: linked by Accounts/views/signup.php and Registrations/views/register.php; js/signup.js fills the certificate and runs the
        eyes and the photo zones.
   Needs: tokens.css and app.css (.field, .input, .form-grid, .btn-gold, .eyebrow, .alert); img/spine-lines.svg; logical properties
          only, so the page mirrors itself in Arabic (spec 11.3). */

/* ---------- The shell: one object, the panel and the sheet joined like the certificate's two halves ---------- */
.signup { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-2); overflow: clip; }
@media (min-width: 1024px) { .signup { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); } }

/* ---------- The emerald panel ---------- */
.signup-panel { position: relative; color: var(--text-on-brand);
  background: url("../img/spine-lines.svg") center top / 100% auto repeat-y,
    radial-gradient(120% 38% at 50% 0%, rgba(59, 175, 152, .28), transparent 72%),
    linear-gradient(180deg, #0F5A4D 0%, var(--teal-700) 46%, #073A32 100%); }
.signup-panel-in { display: grid; gap: var(--space-4); padding: var(--space-7) var(--space-6); }
.signup-panel .eyebrow { margin: 0; color: var(--gold-400); }
.signup-panel .eyebrow::before { background: var(--gold-400); }
.signup-panel h1 { margin: 0; color: var(--text-on-brand); font-family: var(--font-display), var(--font-arabic), sans-serif;
  font-weight: 800; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; }
.signup-lead { margin: 0; font-size: var(--fs-md); line-height: 1.8; color: rgba(255, 255, 255, .78); }

/* The certificate's pearl side in small: its gold frame, its heading, the words before a name, and the name itself. */
.signup-cert { display: none; margin: 0; gap: var(--space-3); }
.signup-cert-sheet { position: relative; display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5);
  background: #F7F6F1; color: var(--ink-900); border-radius: var(--radius-md);
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .2); }
.signup-cert-sheet::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(201, 162, 39, .6);
  border-radius: 5px; pointer-events: none; }
.signup-cert-photo { flex: none; display: grid; place-items: center; inline-size: 58px; block-size: 72px; overflow: hidden;
  border-radius: 4px; background: var(--ink-100); border: 1px solid var(--ink-200); color: var(--ink-400); }
.signup-cert-photo > * { grid-area: 1 / 1; }
.signup-cert-photo .icon { inline-size: 24px; block-size: 24px; }
.signup-cert-photo img { inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 22%; }
.signup-cert-photo:has(img:not([hidden])) .icon { visibility: hidden; }
.signup-cert-text { flex: 1; display: grid; justify-items: center; gap: 5px; min-inline-size: 0; text-align: center; }
.signup-cert-title { font-family: var(--font-display), var(--font-arabic), sans-serif; font-weight: 700; font-size: 15px; color: var(--gold-600); }
.signup-cert-title::after { content: ""; display: block; inline-size: 28px; block-size: 1px; margin: 7px auto 1px; background: var(--gold-500); }
.signup-cert-line { font-size: 11px; line-height: 1.5; color: var(--ink-500); }
.signup-cert-name { max-inline-size: 100%; font-family: var(--font-display), var(--font-arabic), sans-serif; font-weight: 800;
  font-size: 24px; line-height: 1.3; color: var(--ink-900); overflow-wrap: anywhere; transition: color var(--dur-base) var(--ease-out); }
.signup-cert-name.is-empty { color: var(--ink-300); }
.signup-cert-name.is-long { font-size: 18px; }
.signup-cert figcaption { font-size: var(--fs-sm); line-height: 1.7; color: var(--teal-100); }

/* What comes next: three steps on one line down the panel, the first lit in pearl. */
.signup-steps { display: none; list-style: none; margin: 0; padding: 0; gap: var(--space-4); }
.signup-steps li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.signup-steps li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 13.5px; inset-block-start: 32px;
  inline-size: 1px; block-size: calc(100% - 20px); background: rgba(255, 255, 255, .2); }
.signup-steps .step-no { display: grid; place-items: center; inline-size: 28px; block-size: 28px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs-xs); font-weight: 500; color: rgba(255, 255, 255, .85); }
.signup-steps .is-current .step-no { background: #F7F6F1; border-color: transparent; color: var(--teal-700);
  box-shadow: 0 0 0 4px rgba(247, 246, 241, .14); }
.signup-steps b { display: block; font-size: var(--fs-md); font-weight: 600; color: var(--text-on-brand); }
.signup-steps small { display: block; font-size: var(--fs-sm); line-height: 1.6; color: rgba(255, 255, 255, .64); }

.signup-have { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0;
  padding-block-start: var(--space-4); border-block-start: 1px solid rgba(255, 255, 255, .14); font-size: var(--fs-sm);
  color: rgba(255, 255, 255, .78); }
.signup-have a { display: inline-flex; align-items: center; gap: var(--space-2); padding: 8px var(--space-4); border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .38); color: var(--text-on-brand); font-weight: 600; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.signup-have a:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .7); color: var(--text-on-brand); }
.signup-have .icon { inline-size: 16px; block-size: 16px; }

@media (min-width: 1024px) {
  /* The certificate's foil seam, where the panel meets the sheet. */
  .signup-panel::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 1px; pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(220, 187, 97, .55) 18%, rgba(220, 187, 97, .55) 82%, transparent); }
  .signup-panel-in { gap: var(--space-6); padding: var(--space-9) var(--space-8); }
  .signup-cert, .signup-steps { display: grid; }
  .signup-have { padding-block-start: var(--space-5); }
}
/* Where the window is tall enough to hold it, the panel keeps its place while the form scrolls. */
@media (min-width: 1024px) and (min-height: 860px) {
  .signup-panel-in { position: sticky; inset-block-start: calc(68px + var(--space-3)); }
}

/* ---------- The sheet ---------- */
.signup-sheet { min-inline-size: 0; padding: var(--space-6) var(--space-5) var(--space-7); }
@media (min-width: 1024px) { .signup-sheet { padding: var(--space-9) var(--space-9) var(--space-8); } }
.signup-sheet > .alert { margin-block-end: var(--space-6); }
.signup-sec + .signup-sec { margin-block-start: var(--space-2); padding-block-start: var(--space-7); border-block-start: 1px solid var(--border); }
.signup-sec-head { display: flex; align-items: flex-start; gap: var(--space-3); margin-block-end: var(--space-5); }
.signup-sec-icon { flex: none; display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary); }
.signup-sec-icon .icon { inline-size: 20px; block-size: 20px; }
.signup-sec-head h2 { margin: 0; font-family: var(--font-display), var(--font-arabic), sans-serif; font-size: var(--fs-xl);
  font-weight: 700; line-height: 1.35; }
/* "(optional)" in the heading's own size and face, a step quieter in colour and weight. */
.signup-sec-optional { font-weight: 500; color: var(--text-muted); }
.signup-sec-head p { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }

/* Fields a hand can hit: 48 px, the body's own size, a softer ring. */
.signup .field { margin-block-end: var(--space-5); }
.signup .field > label, .signup .field > .label { font-size: var(--fs-sm); color: var(--ink-700); margin-block-end: var(--space-2); }
.signup :is(.input, .select) { min-block-size: 48px; padding: 10px 14px; font-size: var(--fs-md); border-radius: 12px; }
.signup :is(.input, .select):focus { box-shadow: 0 0 0 4px var(--primary-soft); }
.signup .field > :is(.input, .select) { max-inline-size: none; }
.signup #source_other { margin-block-start: var(--space-2); }

.signup-pass { position: relative; display: block; }
.signup-pass .input { padding-inline-end: 52px; }
.signup-pass button { position: absolute; inset-block: 4px; inset-inline-end: 4px; display: grid; place-items: center; inline-size: 42px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); cursor: pointer; }
.signup-pass button:hover { background: var(--ink-50); color: var(--text); }
.signup-pass button[aria-pressed="true"] { color: var(--primary); }
.signup-pass button:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.signup-pass .icon { inline-size: 18px; block-size: 18px; }
.signup .signup-pass-hint { margin: calc(-1 * var(--space-3)) 0 var(--space-5); }

/* A choice of two - the language, and the gender the shared profile fields ask - as two tiles, the picked one filled. */
.signup-choice, .signup .field .row:has(> .radio) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
:is(.signup-choice > label, .signup .row > .radio) { position: relative; display: flex; align-items: center; justify-content: center;
  gap: var(--space-2); min-block-size: 48px; padding-inline: 14px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); font-size: var(--fs-md); font-weight: 500; color: var(--ink-700); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
:is(.signup-choice > label, .signup .row > .radio):hover { border-color: var(--ink-400); }
:is(.signup-choice, .signup .row) input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
:is(.signup-choice > label, .signup .row > .radio):has(input:checked) { border-color: var(--primary); background: var(--primary-soft);
  color: var(--primary); font-weight: 600; box-shadow: inset 0 0 0 1px var(--primary); }
:is(.signup-choice > label, .signup .row > .radio):has(input:checked)::before { content: ""; inline-size: 8px; block-size: 8px;
  border-radius: 50%; background: var(--primary); }
:is(.signup-choice > label, .signup .row > .radio):has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.signup .field.is-invalid .row > .radio { border-color: var(--danger); }

/* ---------- The photo window and the ID: a zone that takes a click or a dropped file ---------- */
.signup-files { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .signup-files:has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.signup-drop { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: var(--space-4) var(--space-5); padding: var(--space-5); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--ink-50); transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.signup-drop.is-enhanced { grid-template-columns: auto minmax(0, 1fr) auto; cursor: pointer; }
.signup-drop.is-enhanced:hover, .signup-drop.is-over { border-color: var(--primary); background: var(--primary-soft); }
.signup-drop.has-file { border-style: solid; border-color: var(--primary); background: var(--surface); }
.signup-drop.is-invalid { border-color: var(--danger); background: #FEF7F5; }
.signup-drop-frame { display: grid; place-items: center; inline-size: 72px; block-size: 90px; overflow: hidden; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-400); }
.signup-drop-frame > * { grid-area: 1 / 1; }
.signup-drop-frame .icon { inline-size: 28px; block-size: 28px; }
.signup-drop-frame img { inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 22%; }
.signup-drop-frame:has(img:not([hidden])) .icon { visibility: hidden; }
.signup-drop:not(.is-photo) .signup-drop-frame { inline-size: 56px; block-size: 56px; border-radius: 50%; }
.signup-drop-text { display: grid; gap: 3px; min-inline-size: 0; }
.signup-drop-text label { font-size: var(--fs-md); color: var(--text); cursor: pointer; }
.signup-drop-text small { font-weight: 400; color: var(--text-muted); }
.signup-drop-text .hint { margin: 0; }
.signup-drop-name { font-size: var(--fs-sm); font-weight: 600; color: var(--primary); overflow-wrap: anywhere; }
.signup-drop-btn { display: none; }
.signup-drop.is-enhanced .signup-drop-btn { display: inline-flex; background: var(--surface); }
.signup-drop > .input { grid-column: 1 / -1; background: var(--surface); }
.signup-drop.is-enhanced > .input { position: absolute; inset-block-end: 0; inline-size: 1px; block-size: 1px; min-block-size: 0; padding: 0;
  opacity: 0; pointer-events: none; }
.signup-drop.is-enhanced:has(> .input:focus-visible) .signup-drop-btn { outline: 2px solid var(--focus); outline-offset: 2px; }
.signup-drop > .field-error { grid-column: 1 / -1; margin: 0; }
@media (max-width: 559px) {
  .signup-drop.is-enhanced { grid-template-columns: auto minmax(0, 1fr); }
  .signup-drop.is-enhanced .signup-drop-btn { grid-column: 1 / -1; justify-content: center; }
}

/* ---------- The one action: gold, the thing the visitor came to do ---------- */
.signup-submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); margin-block-start: var(--space-7);
  padding-block-start: var(--space-6); border-block-start: 1px solid var(--border); }
.signup-submit .btn-gold { min-block-size: 52px; padding-inline: var(--space-8); font-size: var(--fs-md); }
.signup-cancel { color: var(--text-muted); font-weight: 500; text-decoration: none; }
.signup-cancel:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 559px) {
  .signup-submit .btn-gold { flex: 1 1 100%; justify-content: center; }
  .signup-cancel { margin-inline: auto; }
}

/* ---------- A workshop's registration: the same shell, the panel holding the workshop ---------- */
.reg-back { display: inline-flex; align-items: center; gap: var(--space-2); margin-block-end: var(--space-4); color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.reg-back:hover { color: var(--primary); }
.reg-back .icon { inline-size: 16px; block-size: 16px; }
/* A workshop's name is longer than "Create your account": a step smaller, so two lines hold it. */
.reg .signup-panel h1 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.3; }
.reg-facts { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin: 0; }
.reg-facts > div { display: grid; gap: 2px; min-inline-size: 0; }
.reg-facts dt { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--teal-100); }
html[lang="ar"] .reg-facts dt { font-family: var(--font-body), sans-serif; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0; }
.reg-facts dd { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--text-on-brand); }
.reg-window { margin: 0; }
/* The sales tag as it sells on the home page, on a pane of the panel. */
.reg-price { padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14); }
/* Before, the arrow and Now on one row in the pane's width; an amount never breaks inside itself. */
.reg-price .sale-row { gap: var(--space-2) var(--space-3); }
.reg-price .sale :is(.price-was, .price-now) { white-space: nowrap; }
/* A phone's pane has no room for the arrow as well: Before and Now then sit side by side without it. */
.reg-price { container-type: inline-size; }
@container (max-width: 275px) { .reg-price .sale-arrow { display: none; } }
.reg-price .sale .price-was { font-size: var(--fs-lg); }
.reg-price .sale .price-now { font-size: var(--fs-2xl); }
.reg-cert-workshop { max-inline-size: 100%; font-family: var(--font-display), var(--font-arabic), sans-serif; font-weight: 700;
  font-size: 13px; line-height: 1.5; color: var(--teal-700); overflow-wrap: anywhere; }
/* A phone or a tablet, where the panel is a band over the form (owner 2026-09-27): the band says only which workshop this is. The
   price and "Already have an account? Sign in" confused a student who had just chosen to create an account and book; the workshop's
   page showed the price, and an address already taken still gets its sign-in link inside the form. */
@media (max-width: 1023px) { .reg .reg-price, .reg .signup-have { display: none; } }
/* A button beside a box is as tall as the box. */
.signup .input-group .btn { min-block-size: 48px; }
