/* ============================================================
   HIRMAN — LOGIN / REGISTER
   Minimal form floating directly on a full-bleed, fixed photo —
   same "cinema" language as the marketing site (landing.css:
   .cinema-hero / .cinema-scene / .cinema-media), taken further:
   no card, no split panel. The image IS the page; the form is
   just type sitting on top of it, same way a ticket confirmation
   sits over a film still.

   FORM SUBMISSION: JS further down intercepts submit on all
   three forms (login / register / verify-code) and calls the
   real JSON API — POST /api/auth/login, /api/auth/register,
   /api/auth/verify — via fetch(); the backend's _read_body()
   only understands a JSON body, never a native form-urlencoded
   POST. Session is a cookie the backend sets itself
   (Set-Cookie: hirman_session), so on success we just redirect
   to "/". Registration requires an emailed code before a
   session is issued, hence the extra verify step. None of this
   changed in this pass — only the visual layer below did.
   ============================================================ */
:root{
  --font:'Vazirmatn','Tahoma',sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,'SF Mono',monospace;

  --text:#F4F1EA; --muted:#C7CCDA; --muted-soft:#8D96AA;

  --navy:#2B4970; --navy-dark:#04122F; --navy-deep:#02060F;
  --rose-dark:#F8C7D0; --rose-soft:rgba(184,65,90,.22);
  --green:#9BE7C9; --green-soft:rgba(25,137,102,.2);
  --gold:#D7AF77; --gold-soft:rgba(200,155,92,.18); --gold-glow:rgba(200,155,92,.4);

  --radius-sm:12px; --radius-md:16px;
  --ease:cubic-bezier(.16,.8,.24,1); --ease-spring:cubic-bezier(.2,.9,.16,1.14);
  --safe-t:env(safe-area-inset-top,0px); --safe-b:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;}
html{background:var(--navy-dark);}
html,body{min-height:100%;}
body{margin:0;font-family:var(--font);color:var(--text);direction:rtl;
  -webkit-font-smoothing:antialiased;line-height:1.6;opacity:0;position:relative;}
body.is-ready{opacity:1;transition:opacity .5s var(--ease);}
@media (prefers-reduced-motion: reduce){ body{opacity:1 !important;} }
img,svg{display:block;}
a{color:inherit;text-decoration:none;}
button,input{font-family:inherit;}
::selection{background:rgba(200,155,92,.3);color:#fff;}

/* ---------------- the photo — fixed behind everything, never scrolls ---------------- */
.stage{position:fixed;inset:0;z-index:0;overflow:hidden;background:var(--navy-dark);}
.cinema-photo{position:absolute;inset:0;}
.cinema-photo-img{width:100%;height:100%;object-fit:cover;object-position:center 30%;}
.cinema-photo-overlay{position:absolute;inset:0;
  background:
    linear-gradient(180deg,rgba(2,6,15,.58) 0%,rgba(2,6,15,.42) 32%,rgba(2,6,15,.66) 68%,rgba(2,6,15,.9) 100%),
    radial-gradient(90% 70% at 50% 38%,transparent 30%,rgba(2,6,15,.4) 100%);}

/* corner viewfinder marks — the one deliberate flourish: a quiet nod
   to the photo itself, a kit framed and ready before the work
   begins. fixed to the frame, not the scrolling content. */
.viewfinder{position:absolute;inset:22px;pointer-events:none;}
.viewfinder i{position:absolute;width:22px;height:22px;border-color:rgba(244,241,234,.38);border-style:solid;border-width:0;}
.viewfinder i:nth-child(1){top:0;right:0;border-top-width:1.5px;border-right-width:1.5px;border-top-right-radius:4px;}
.viewfinder i:nth-child(2){top:0;left:0;border-top-width:1.5px;border-left-width:1.5px;border-top-left-radius:4px;}
.viewfinder i:nth-child(3){bottom:0;right:0;border-bottom-width:1.5px;border-right-width:1.5px;border-bottom-right-radius:4px;}
.viewfinder i:nth-child(4){bottom:0;left:0;border-bottom-width:1.5px;border-left-width:1.5px;border-bottom-left-radius:4px;}
@media (max-width:480px){ .viewfinder{inset:14px;} .viewfinder i{width:16px;height:16px;} }

/* ---------------- top bar: logo + back link, floats over the photo ---------------- */
.auth-top{position:relative;z-index:2;padding:calc(var(--safe-t) + 20px) 26px 6px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;}
.brand{display:flex;align-items:center;gap:10px;min-width:0;}
.brand-logo{width:104px;height:auto;aspect-ratio:10/3;object-fit:contain;flex:0 0 auto;}
.back-link{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:650;color:rgba(244,241,234,.6);flex-shrink:0;
  transition:color .25s var(--ease);}
.back-link:hover{color:#fff;}
.back-link svg{width:15px;height:15px;}

/* ---------------- centered minimal form — the whole page's real content ---------------- */
.auth-center{position:relative;z-index:2;min-height:calc(100vh - 70px);display:flex;align-items:center;justify-content:center;
  padding:26px 26px calc(var(--safe-b) + 40px);}
.auth-minimal{width:100%;max-width:360px;}

.eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:11.5px;font-weight:750;color:var(--muted);
  background:rgba(255,255,255,.08);padding:6px 13px 6px 10px;border-radius:999px;margin-bottom:20px;letter-spacing:.03em;}
.eyebrow i{width:6px;height:6px;border-radius:50%;background:var(--gold);flex-shrink:0;}

.auth-head{margin-bottom:22px;}
.auth-head h1{font-size:25px;font-weight:800;margin:0;letter-spacing:-.01em;color:#fff;
  text-shadow:0 2px 18px rgba(0,0,0,.4);}
.auth-head p{margin-top:7px;font-size:13.5px;color:var(--muted);}

/* -- tabs: two plain words + a thin sliding underline, nothing boxed -- */
.auth-tabs{position:relative;display:flex;gap:26px;margin-bottom:28px;border-bottom:1px solid rgba(244,241,234,.16);}
.auth-tabs[hidden]{display:none;}
.auth-tabs button{position:relative;border:none;background:none;padding:0 0 12px;font-size:14.5px;font-weight:700;
  color:var(--muted-soft);cursor:pointer;font-family:inherit;transition:color .3s var(--ease);}
.auth-tabs button.on{color:#fff;}
.auth-tabs .tab-line{position:absolute;bottom:-1px;height:2px;width:64px;background:var(--gold);border-radius:2px;
  box-shadow:0 0 12px var(--gold-glow);transition:transform .4s var(--ease-spring);}
.auth-tabs .tab-line.to-register{transform:translateX(calc(-100% - 26px));}

/* -- form fields: minimal underline style, no card behind them -- */
.auth-forms{position:relative;}
.auth-form{display:flex;flex-direction:column;gap:20px;}
.auth-form[hidden]{display:none;}
.field{position:relative;}
.field input{width:100%;height:auto;padding:4px 2px 11px;border:none;border-bottom:1.5px solid rgba(244,241,234,.3);
  border-radius:0;background:transparent;font-size:15px;color:#fff;font-family:inherit;
  transition:border-color .25s var(--ease);}
.field input:focus{outline:none;border-bottom-color:var(--gold);}
.field label{position:absolute;right:2px;top:4px;font-size:15px;color:var(--muted);pointer-events:none;
  transition:transform .2s var(--ease),font-size .2s var(--ease),color .2s var(--ease);transform-origin:right top;}
.field input:focus + label,.field input:not(:placeholder-shown) + label{
  transform:translateY(-19px) scale(.76);color:var(--gold);}
.field-pw-toggle{position:absolute;left:0;bottom:6px;width:26px;height:26px;border-radius:8px;border:none;background:none;
  color:var(--muted-soft);display:grid;place-items:center;cursor:pointer;}
.field-pw-toggle svg{width:18px;height:18px;}
.field-pw-toggle:hover{color:var(--gold);}
.field-hint{font-size:11.5px;color:var(--rose-dark);margin-top:6px;display:none;}
.field.has-error input{border-bottom-color:#E17A93;}
.field.has-error .field-hint{display:block;}

.auth-notice{font-size:13px;line-height:1.7;border-radius:var(--radius-sm);padding:11px 14px;margin-bottom:18px;font-weight:600;
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);}
.auth-notice[hidden]{display:none;}
.auth-notice.is-error{color:var(--rose-dark);background:var(--rose-soft);border:1px solid rgba(184,65,90,.4);}
.auth-notice.is-info{color:var(--green);background:var(--green-soft);border:1px solid rgba(25,137,102,.4);}

.code-field input{letter-spacing:7px;text-align:center;font-family:var(--font-mono);font-size:19px;}
.auth-resend{background:none;border:none;color:var(--gold);font-weight:700;cursor:pointer;font-family:inherit;font-size:13px;padding:0;}
.auth-resend[disabled]{opacity:.55;cursor:default;}

.form-row-between{display:flex;align-items:center;justify-content:space-between;font-size:13px;}
.checkbox-row{display:flex;align-items:flex-start;gap:9px;font-size:12.5px;color:var(--muted);line-height:1.7;cursor:pointer;}
.checkbox-row input{appearance:none;width:17px;height:17px;border-radius:5px;border:1.5px solid rgba(244,241,234,.35);flex-shrink:0;margin-top:1px;
  background:transparent;cursor:pointer;position:relative;transition:background .2s var(--ease),border-color .2s var(--ease);}
.checkbox-row input:checked{background:var(--gold);border-color:var(--gold);}
.checkbox-row input:checked::after{content:'';position:absolute;right:4.5px;top:1px;width:5px;height:8px;border:solid #04122F;border-width:0 2px 2px 0;transform:rotate(45deg);}
.checkbox-row a{color:#fff;font-weight:700;text-decoration:underline;text-decoration-color:rgba(255,255,255,.35);text-underline-offset:2px;}
.remember-label{display:flex;align-items:center;gap:7px;color:var(--muted);cursor:pointer;}
.remember-label input{appearance:none;width:16px;height:16px;border-radius:5px;border:1.5px solid rgba(244,241,234,.35);background:transparent;cursor:pointer;position:relative;}
.remember-label input:checked{background:var(--gold);border-color:var(--gold);}
.remember-label input:checked::after{content:'';position:absolute;right:4px;top:0.5px;width:4px;height:8px;border:solid #04122F;border-width:0 1.6px 1.6px 0;transform:rotate(45deg);}
.forgot-link{color:var(--muted);font-weight:650;text-decoration:underline;text-decoration-color:rgba(244,241,234,.3);text-underline-offset:2px;}
.forgot-link:hover{color:#fff;}

/* -- button: the one solid shape on an otherwise line-based page -- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;border-radius:999px;font-family:inherit;
  font-weight:700;font-size:15px;padding:13px 24px;cursor:pointer;border:1px solid transparent;white-space:nowrap;position:relative;
  transition:transform .3s var(--ease-spring),box-shadow .3s var(--ease),background .3s var(--ease);}
.btn:active{transform:translateY(1px) scale(.98);}
.btn-primary{width:100%;background:linear-gradient(135deg,#3D6191,#152744);color:#fff;
  box-shadow:0 14px 30px rgba(2,6,15,.5),0 0 0 1px rgba(255,255,255,.06) inset;}
.btn-primary:hover{transform:translateY(-2px);box-shadow:0 18px 38px rgba(2,6,15,.55),0 0 44px var(--gold-glow),0 0 0 1px rgba(255,255,255,.1) inset;}
.btn-primary[disabled]{opacity:.7;cursor:default;transform:none;}
.btn-lg{padding:16px 22px;font-size:15.5px;margin-top:4px;}
.spinner{width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;
  animation:spin .7s linear infinite;display:none;flex-shrink:0;}
@keyframes spin{to{transform:rotate(360deg);}}
.btn.is-loading .spinner{display:inline-block;}
.btn.is-loading .btn-label{opacity:.85;}
@media (prefers-reduced-motion: reduce){ .spinner{animation:none;border-top-color:rgba(255,255,255,.7);} }

.auth-switch-note{text-align:center;margin-top:22px;font-size:13.5px;color:var(--muted);}
.auth-switch-note button{background:none;border:none;color:var(--gold);font-weight:700;cursor:pointer;font-family:inherit;font-size:13.5px;padding:0;}
.auth-terms-note{margin-top:14px;text-align:center;font-size:11px;color:var(--muted-soft);line-height:1.8;}
.auth-terms-note a{color:var(--muted);font-weight:700;}

@media (max-width:480px){
  .auth-top{padding:calc(var(--safe-t) + 16px) 20px 4px;}
  .brand-logo{width:96px;}
  .auth-center{padding:22px 22px calc(var(--safe-b) + 30px);}
  .auth-head h1{font-size:22px;}
  .field input{font-size:16px;padding:4px 2px 12px;}
  .field label{font-size:16px;}
}
