:root{
  --bg:#f7f8fc;
  --surface:rgba(255,255,255,.92);
  --surface-solid:#fff;
  --surface2:#f3f5fb;
  --text:#111525;
  --muted:#70788d;
  --border:rgba(20,27,48,.09);
  --primary:#625cf6;
  --primary2:#8338ec;
  --primary-soft:#f0efff;
  --success:#21b77a;
  --danger:#e84d69;
  --shadow:0 24px 70px rgba(37,43,82,.10);
  --shadow-soft:0 10px 30px rgba(37,43,82,.07);
  --header:rgba(248,249,253,.82);
  --input:#fff;
}
:root[data-theme="dark"]{
  --bg:#0b0f19;
  --surface:rgba(18,23,36,.92);
  --surface-solid:#121724;
  --surface2:#171d2b;
  --text:#f4f6fb;
  --muted:#9ba4b8;
  --border:rgba(255,255,255,.08);
  --primary:#847cff;
  --primary2:#a45cff;
  --primary-soft:rgba(126,112,255,.12);
  --success:#3ed495;
  --danger:#ff6f88;
  --shadow:0 24px 70px rgba(0,0,0,.28);
  --shadow-soft:0 10px 30px rgba(0,0,0,.20);
  --header:rgba(11,15,25,.82);
  --input:#0f1420;
}
*{box-sizing:border-box}
html{
  width:100%;
  min-height:100%;
  background:var(--bg);
  overflow-x:hidden;
}
body{
  margin:0;
  min-width:0;
  min-height:100%;
  background:
    radial-gradient(900px 480px at 76% 30%,color-mix(in srgb,var(--primary) 8%,transparent),transparent 68%),
    radial-gradient(760px 440px at 10% 84%,color-mix(in srgb,#4c8dff 6%,transparent),transparent 68%),
    var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
button,input{font:inherit}
.svg-sprite{position:absolute;width:0;height:0;overflow:hidden}

/* ---------- top bar ---------- */
.auth-header{
  position:sticky;
  top:0;
  z-index:40;
  height:72px;
  background:var(--header);
  backdrop-filter:blur(20px) saturate(145%);
  -webkit-backdrop-filter:blur(20px) saturate(145%);
  border-bottom:1px solid var(--border);
}
.auth-nav{
  width:min(calc(100% - 36px),1240px);
  height:72px;
  margin:auto;
  display:flex;
  align-items:center;
  gap:22px;
}
.site-brand{
  flex:0 1 210px;
  min-width:132px;
  max-width:210px;
  height:58px;
  display:flex;
  align-items:center;
  overflow:hidden;
}
.site-brand img{
  display:block;
  width:auto;
  height:auto;
  max-height:48px;
  max-width:205px;
  object-fit:contain;
  object-position:left center;
}
.desktop-links{
  display:flex;
  align-items:center;
  gap:26px;
  margin-left:auto;
  font-size:13px;
  color:var(--muted);
}
.desktop-links a{transition:color .18s ease,transform .18s ease}
.desktop-links a:hover{color:var(--text);transform:translateY(-1px)}
.nav-actions{display:flex;align-items:center;gap:9px;margin-left:2px}
.nav-icon,.nav-auth-link{
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:0 4px 14px rgba(20,27,48,.03);
}
.nav-icon{
  width:40px;height:40px;border-radius:13px;color:var(--text);
  display:grid;place-items:center;cursor:pointer;
  transition:transform .18s ease,background .18s ease,border-color .18s ease;
}
.nav-icon:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--primary) 25%,var(--border))}
.nav-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.menu-btn{display:none}
.nav-auth-link{
  height:40px;padding:0 17px;border-radius:13px;font-size:12px;font-weight:750;
  display:inline-flex;align-items:center;
}
.mobile-menu{
  display:none;
  position:absolute;
  top:64px;left:12px;right:12px;
  background:var(--surface-solid);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:10px;
}
.mobile-menu.open{display:grid}
.mobile-menu a{padding:12px;border-radius:11px;color:var(--muted);font-size:13px}
.mobile-menu a:hover{background:var(--surface2);color:var(--text)}

/* ---------- main shell ---------- */
.auth-page{
  min-height:100dvh;
}
.auth-layout{
  width:min(calc(100% - 36px),1240px);
  min-height:calc(100dvh - 72px);
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(400px,500px);
  gap:clamp(44px,6vw,92px);
  align-items:center;
  padding:clamp(30px,5vh,56px) 0;
}
.auth-intro{min-width:0;display:flex;align-items:center}
.intro-inner{max-width:610px}
.eyebrow{
  display:inline-flex;align-items:center;gap:10px;
  color:var(--primary);font-size:10px;font-weight:850;letter-spacing:.18em
}
.eyebrow:before{content:"";width:24px;height:2px;border-radius:99px;background:var(--primary)}
.intro-inner h1{
  font-family:Manrope,Inter,sans-serif;
  font-size:clamp(43px,5.2vw,68px);
  line-height:1.02;letter-spacing:-.055em;
  margin:16px 0 17px;
  max-width:720px;
}
.intro-inner h1 span{
  background:linear-gradient(95deg,var(--primary),var(--primary2),#4c8dff);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.intro-inner h1 span b{font:inherit}
.intro-inner p{
  max-width:590px;margin:0;color:var(--muted);
  font-size:14px;line-height:1.75
}
.feature-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:22px}
.feature-row span{
  padding:7px 10px;border-radius:999px;background:var(--primary-soft);
  border:1px solid var(--border);color:var(--muted);font-size:10px;font-weight:700
}

/* ---------- auth card ---------- */
.auth-form-area{width:100%;min-width:0}
.auth-card{
  width:100%;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:24px;
  padding:26px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.card-head{
  display:flex;justify-content:space-between;align-items:flex-start;gap:16px;
  margin-bottom:22px
}
.mini-label{
  display:block;color:var(--primary);font-size:9px;letter-spacing:.17em;
  font-weight:850;margin-bottom:8px
}
.card-head h2{
  font-family:Manrope,Inter,sans-serif;font-size:29px;
  letter-spacing:-.04em;margin:0 0 6px
}
.card-head p{margin:0;color:var(--muted);font-size:12px;line-height:1.6;max-width:350px}
.secure-dot{
  white-space:nowrap;display:inline-flex;align-items:center;gap:7px;
  border:1px solid var(--border);background:var(--surface2);
  padding:7px 9px;border-radius:999px;color:var(--muted);font-size:9px;font-weight:750
}
.secure-dot i{
  width:7px;height:7px;border-radius:50%;background:var(--success);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--success) 14%,transparent)
}
.form-message{
  display:none;padding:11px 13px;border-radius:12px;font-size:12px;
  line-height:1.5;margin-bottom:14px
}
.form-message.error{
  display:block;color:var(--danger);background:color-mix(in srgb,var(--danger) 8%,transparent);
  border:1px solid color-mix(in srgb,var(--danger) 22%,transparent)
}
.form-message.success{
  display:block;color:var(--success);background:color-mix(in srgb,var(--success) 8%,transparent);
  border:1px solid color-mix(in srgb,var(--success) 22%,transparent)
}
.form-grid{display:grid;gap:13px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-group{display:grid;gap:6px;min-width:0}
.form-group label{font-size:11px;font-weight:780}
.form-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.auth-input{
  width:100%;height:48px;border:1px solid var(--border);border-radius:13px;
  background:var(--input);color:var(--text);outline:none;padding:0 14px;font-size:12px;
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease
}
.auth-input::placeholder{color:color-mix(in srgb,var(--muted) 72%,transparent)}
.auth-input:focus{
  border-color:color-mix(in srgb,var(--primary) 62%,var(--border));
  box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 9%,transparent)
}
.input-wrap{position:relative}
.input-wrap .auth-input{padding-right:67px}
.password-toggle{
  position:absolute;right:6px;top:6px;height:36px;
  border:1px solid var(--border);border-radius:10px;background:var(--surface2);
  color:var(--muted);padding:0 10px;font-size:9px;font-weight:780;cursor:pointer
}
.forgot-link{font-size:10px;color:var(--primary);font-weight:780}
.username-help{font-size:9px;color:var(--muted);margin-top:-3px}
.terms-row{
  display:flex;align-items:flex-start;gap:9px;padding:10px 11px;
  border:1px solid var(--border);border-radius:13px;background:var(--surface2);cursor:pointer
}
.terms-row input{width:16px;height:16px;flex:0 0 16px;margin:1px 0 0;accent-color:var(--primary)}
.terms-row span{font-size:10px;line-height:1.5;color:var(--muted)}
.terms-row b{color:var(--text)}
.terms-row a{color:var(--primary);font-weight:750}
.auth-btn{
  width:100%;height:48px;border:0;border-radius:13px;
  background:linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff;font-size:12px;font-weight:850;cursor:pointer;
  box-shadow:0 11px 26px color-mix(in srgb,var(--primary) 22%,transparent);
  transition:transform .18s ease,box-shadow .18s ease,filter .18s ease
}
.auth-btn:hover{transform:translateY(-1px);filter:saturate(1.06);box-shadow:0 15px 30px color-mix(in srgb,var(--primary) 27%,transparent)}
.auth-btn:disabled{opacity:.58;cursor:wait;transform:none}
.switch{text-align:center;color:var(--muted);font-size:10px;margin-top:15px}
.switch a,.auth-note a{color:var(--primary);font-weight:800}
.auth-note{text-align:center;color:var(--muted);font-size:9px;margin-top:10px;line-height:1.5}

/* Register is slightly denser so common laptop/tablet heights don't scroll unnecessarily */
.register-card{padding:23px 24px}
.register-card .card-head{margin-bottom:18px}
.register-card .form-grid{gap:11px}
.register-card .auth-input{height:45px}
.register-card .password-toggle{height:33px;top:6px}
.register-card .auth-btn{height:46px}
.register-card .switch{margin-top:13px}

/* status pages compatibility */
.status-icon{width:62px;height:62px;border-radius:18px;display:grid;place-items:center;font-size:26px;margin-bottom:18px;background:var(--primary-soft);border:1px solid var(--border)}
.status-icon.success{color:var(--success)}
.status-title{font-family:Manrope,Inter,sans-serif;font-size:30px;letter-spacing:-.04em;margin:0 0 9px}
.status-copy{font-size:13px;line-height:1.75;color:var(--muted);margin:0}
.email-preview{margin:18px 0;padding:14px 15px;border:1px solid var(--border);border-radius:14px;background:var(--surface2)}
.email-preview small{display:block;color:var(--muted);font-size:9px;letter-spacing:.12em;text-transform:uppercase;margin-bottom:5px;font-weight:800}
.email-preview strong{font-size:13px}
.steps{display:grid;gap:9px;margin:19px 0}
.step{display:flex;gap:11px;align-items:flex-start;padding:12px 13px;border-radius:13px;background:var(--surface2);border:1px solid var(--border)}
.step-num{flex:0 0 25px;width:25px;height:25px;border-radius:8px;background:var(--primary-soft);color:var(--primary);display:grid;place-items:center;font-size:10px;font-weight:850}
.step div:last-child{font-size:11px;line-height:1.55;color:var(--muted)}
.step b{display:block;color:var(--text);margin-bottom:2px}
.secondary-btn{width:100%;height:48px;border:1px solid var(--border);border-radius:13px;background:var(--surface2);color:var(--text);font-weight:750;cursor:pointer}

/* ---------- responsive ---------- */
@media (max-width:980px){
  .desktop-links{display:none}
  .menu-btn{display:grid}
  .auth-layout{
    grid-template-columns:minmax(0,.82fr) minmax(390px,1fr);
    gap:32px;
  }
  .intro-inner h1{font-size:clamp(38px,5.2vw,54px)}
}

@media (max-width:760px){
  .auth-header{height:64px}
  .auth-nav{height:64px;width:min(calc(100% - 24px),1240px)}
  .site-brand{flex-basis:180px;max-width:180px;height:54px}
  .site-brand img{max-width:176px;max-height:44px}
  .nav-auth-link{display:none}

  .auth-layout{
    width:min(calc(100% - 24px),620px);
    min-height:calc(100dvh - 64px);
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:14px;
    padding:18px 0 22px;
  }

  /* On handheld devices the form is the task; keep the page compact. */
  .auth-intro{
    width:100%;
    display:block;
  }
  .intro-inner{
    max-width:none;
    text-align:left;
  }
  .eyebrow{font-size:9px}
  .intro-inner h1{
    font-size:clamp(30px,8.5vw,42px);
    margin:10px 0 8px;
    max-width:560px;
  }
  .intro-inner p{
    font-size:12px;
    line-height:1.55;
    max-width:560px;
  }
  .feature-row{display:none}

  .auth-form-area{max-width:none}
  .auth-card{padding:19px;border-radius:20px}
  .card-head{margin-bottom:17px}
  .card-head h2{font-size:25px}
  .secure-dot{display:none}
  .two-col{grid-template-columns:1fr}
  .register-card .two-col{grid-template-columns:1fr 1fr}
  .auth-note{margin-top:8px}
}

@media (max-width:560px){
  .auth-nav{gap:10px}
  .site-brand{
    min-width:0;
    flex:1 1 156px;
    max-width:168px;
  }
  .site-brand img{
    max-width:164px;
    max-height:42px;
  }
  .nav-actions{margin-left:auto}
  .nav-icon{width:38px;height:38px;border-radius:12px}

  .auth-layout{
    width:min(calc(100% - 20px),520px);
    justify-content:flex-start;
    padding:14px 0 18px;
    gap:12px;
  }
  .intro-inner h1{font-size:31px;line-height:1.04;margin:8px 0 6px}
  .intro-inner p{
    display:none; /* avoids unnecessary vertical scrolling on small phones */
  }
  .auth-card{
    padding:17px;
    border-radius:18px;
    box-shadow:var(--shadow-soft);
  }
  .card-head{margin-bottom:15px}
  .card-head h2{font-size:24px}
  .card-head p{font-size:11px}
  .form-grid{gap:11px}
  .auth-input{height:46px}
  .auth-btn{height:46px}

  /* Registration needs more fields; use single column only on narrow phones. */
  .register-card .two-col{grid-template-columns:1fr}
  .register-card{padding:16px}
  .register-card .card-head{margin-bottom:14px}
  .register-card .auth-input{height:44px}
  .register-card .form-grid{gap:10px}
  .terms-row{padding:9px}
}

@media (max-width:380px){
  .site-brand{max-width:145px}
  .site-brand img{max-width:140px}
  .auth-layout{width:calc(100% - 16px)}
  .intro-inner h1{font-size:27px}
  .auth-card{padding:14px}
}

/* Short-height desktop/tablet: avoid giant empty space and unnecessary body scrolling. */
@media (min-width:761px) and (max-height:720px){
  .auth-layout{
    padding:20px 0;
    min-height:calc(100dvh - 72px);
    gap:34px;
  }
  .intro-inner h1{font-size:clamp(38px,4.5vw,56px);margin:12px 0 12px}
  .intro-inner p{font-size:13px;line-height:1.55}
  .feature-row{margin-top:16px}
  .auth-card{padding:21px 23px}
  .card-head{margin-bottom:16px}
  .form-grid{gap:10px}
  .auth-input{height:44px}
  .auth-btn{height:45px}
  .register-card{padding:18px 21px}
  .register-card .card-head{margin-bottom:13px}
  .register-card .form-grid{gap:8px}
  .register-card .auth-input{height:42px}
  .register-card .auth-btn{height:43px}
}




/* ============================================================
   RESPONSIVE AUTH v4 — desktop / tablet / phone friendly
   ============================================================ */

html,body.auth-page{
  width:100%;
  min-width:0;
  overflow-x:hidden;
}

.auth-header{
  width:100%;
}
.auth-nav{
  width:min(calc(100% - 36px),1240px);
  display:grid;
  grid-template-columns:minmax(170px,240px) 1fr auto;
  align-items:center;
  gap:24px;
}
.auth-header .site-brand{
  width:100%;
  max-width:230px;
  min-width:0;
  height:58px;
  display:flex;
  align-items:center;
  overflow:hidden;
}
.auth-header .site-brand img{
  width:auto !important;
  height:auto !important;
  max-width:220px !important;
  max-height:50px !important;
  object-fit:contain !important;
  object-position:left center !important;
}
.auth-header .desktop-links{
  margin:0;
  justify-self:center;
}
.auth-header .nav-actions{
  justify-self:end;
  margin:0;
}

/* True desktop: split hero + form, centered vertically */
@media (min-width:1101px){
  .auth-layout{
    width:min(calc(100% - 64px),1240px) !important;
    min-height:calc(100dvh - 72px) !important;
    margin:0 auto !important;
    padding:34px 0 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(420px,500px) !important;
    gap:clamp(56px,7vw,110px) !important;
    align-items:center !important;
  }
  .auth-intro{
    display:flex !important;
    width:auto !important;
  }
  .intro-inner{
    max-width:650px !important;
  }
  .intro-inner h1{
    font-size:clamp(46px,4.5vw,68px) !important;
    line-height:1.03 !important;
    letter-spacing:-.052em !important;
    text-wrap:balance;
  }
  .intro-inner h1 [data-app]{
    white-space:nowrap;
  }
  .auth-form-area{
    max-width:500px !important;
    width:100% !important;
    justify-self:end;
  }
}

/* Tablet / narrow desktop: stack elegantly, no giant empty middle space */
@media (min-width:701px) and (max-width:1100px){
  .auth-nav{
    display:flex !important;
    gap:14px !important;
  }
  .auth-header .site-brand{
    margin-right:auto;
    max-width:205px;
  }
  .auth-header .site-brand img{
    max-width:198px !important;
    max-height:46px !important;
  }
  .auth-header .desktop-links{
    display:none !important;
  }

  .auth-layout{
    width:min(calc(100% - 40px),760px) !important;
    min-height:calc(100dvh - 72px) !important;
    margin:0 auto !important;
    padding:34px 0 46px !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    align-items:stretch !important;
    gap:24px !important;
  }
  .auth-intro{
    width:100% !important;
    display:block !important;
  }
  .intro-inner{
    max-width:700px !important;
  }
  .intro-inner h1{
    font-size:clamp(38px,6vw,52px) !important;
    line-height:1.04 !important;
    margin:12px 0 12px !important;
    text-wrap:balance;
  }
  .intro-inner h1 [data-app]{
    white-space:nowrap;
  }
  .auth-form-area{
    width:100% !important;
    max-width:700px !important;
  }
  .auth-card{
    width:100% !important;
  }
}

/* Phone: form-first interface, clean header, no needless page travel */
@media (max-width:700px){
  .auth-header{
    height:64px !important;
  }
  .auth-nav{
    width:calc(100% - 22px) !important;
    height:64px !important;
    display:flex !important;
    gap:8px !important;
  }
  .auth-header .site-brand{
    flex:1 1 auto !important;
    width:auto !important;
    max-width:178px !important;
    height:52px !important;
    margin-right:auto !important;
  }
  .auth-header .site-brand img{
    max-width:174px !important;
    max-height:45px !important;
  }
  .auth-header .desktop-links,
  .auth-header .nav-auth-link{
    display:none !important;
  }
  .auth-header .nav-actions{
    display:flex !important;
    gap:7px !important;
  }
  .auth-header .nav-icon{
    width:38px !important;
    height:38px !important;
  }
  .auth-header .menu-btn{
    display:grid !important;
  }

  .auth-layout{
    width:calc(100% - 20px) !important;
    min-height:calc(100dvh - 64px) !important;
    margin:0 auto !important;
    padding:18px 0 28px !important;
    display:flex !important;
    flex-direction:column !important;
    justify-content:flex-start !important;
    gap:12px !important;
  }
  .auth-intro{
    display:none !important;
  }
  .auth-form-area{
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
  }
  .auth-card,
  .register-card{
    width:100% !important;
    margin:0 !important;
    padding:18px !important;
    border-radius:19px !important;
    box-shadow:none !important;
  }
  .card-head{
    margin-bottom:16px !important;
  }
  .card-head h2{
    font-size:25px !important;
  }
  .secure-dot{
    display:none !important;
  }
  .two-col,
  .register-card .two-col{
    grid-template-columns:1fr !important;
  }
}

/* Short desktop windows: stay compact without breaking columns. */
@media (min-width:1101px) and (max-height:760px){
  .auth-layout{
    min-height:calc(100dvh - 72px) !important;
    padding:22px 0 !important;
  }
  .intro-inner h1{
    font-size:clamp(40px,4vw,56px) !important;
    margin:10px 0 !important;
  }
  .feature-row{
    margin-top:14px !important;
  }
  .auth-card{
    padding:20px 22px !important;
  }
  .register-card{
    padding:18px 21px !important;
  }
}

/* Never allow configured app names to break awkwardly inside register heading. */
.auth-register .intro-inner h1 [data-app]{
  display:inline;
  white-space:nowrap;
}
