@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --auth-brand: #007AFF;
  --auth-brand-2: #5856D6;
  --auth-bg: #f5f5f7;
  --auth-surface: #fff;
  --auth-border: rgba(0,0,0,.1);
  --auth-border-strong: rgba(0,0,0,.18);
  --auth-text: #111;
  --auth-text-2: #555;
  --auth-text-3: #999;
  --auth-err-bg: #fff5f5;
  --auth-err-border: #fca5a5;
  --auth-err-text: #b91c1c;
  --auth-ok-bg: #f0fdf4;
  --auth-ok-border: #86efac;
  --auth-ok-text: #15803d;

  --auth-panel-bg: #fff;
  --auth-panel-text: #111;
  --auth-panel-eyebrow: rgba(0,0,0,.4);
  --auth-panel-subtitle: rgba(0,0,0,.55);
  --auth-panel-footer: rgba(0,0,0,.3);
  --auth-orb-opacity: .25;
}

@media (prefers-color-scheme: dark) {
  :root {
    --auth-bg: #0a0a0a;
    --auth-surface: #1c1c1e;
    --auth-border: rgba(255,255,255,.1);
    --auth-border-strong: rgba(255,255,255,.2);
    --auth-text: #f0f0f0;
    --auth-text-2: #aaa;
    --auth-text-3: #555;
    --auth-err-bg: #2d1515;
    --auth-err-border: #7f1d1d;
    --auth-err-text: #fca5a5;
    --auth-ok-bg: #052e16;
    --auth-ok-border: #166534;
    --auth-ok-text: #86efac;

    --auth-panel-bg: #0a0a0a;
    --auth-panel-text: #fff;
    --auth-panel-eyebrow: rgba(255,255,255,.35);
    --auth-panel-subtitle: rgba(255,255,255,.45);
    --auth-panel-footer: rgba(255,255,255,.2);
    --auth-orb-opacity: .4;
  }
}

html, body {
  height: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--auth-bg);
  color: var(--auth-text);
}

:focus-visible { outline: 2px solid var(--auth-brand); outline-offset: 2px; }

.auth-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* Left panel */
.auth-panel-left {
  background: var(--auth-panel-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--auth-border);
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--auth-orb-opacity); }
.auth-orb-1 { width: 400px; height: 400px; background: var(--auth-brand); top: -150px; right: -100px; }
.auth-orb-2 { width: 350px; height: 350px; background: var(--auth-brand-2); bottom: -120px; left: -80px; }

.auth-brand-row { display: flex; align-items: center; gap: .6rem; position: relative; z-index: 1; }
.brand-lockup { display: inline-flex; align-items: center; gap: .12em; font-weight: 800; font-size: 1.6rem; color: var(--auth-panel-text); }
.brand-logo { width: 1.25em; height: 1.25em; color: currentColor; flex-shrink: 0; }

.auth-panel-body { position: relative; z-index: 1; }
.auth-eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--auth-panel-eyebrow); margin-bottom: .85rem;
}
.auth-headline {
  font-size: 2.4rem; font-weight: 800; color: var(--auth-panel-text); line-height: 1.1;
  letter-spacing: -.03em; margin-bottom: .85rem;
}
.auth-subtitle { font-size: .9rem; color: var(--auth-panel-subtitle); line-height: 1.65; max-width: 280px; }
.auth-panel-footer { font-size: .72rem; color: var(--auth-panel-footer); position: relative; z-index: 1; }

.auth-mobile-header { display: none; }

/* Right panel */
.auth-panel-right { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--auth-bg); }
.auth-form-box { width: 100%; max-width: 360px; }

.auth-back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--auth-text-2); text-decoration: none;
  margin-bottom: 1.75rem; transition: color .15s;
}
.auth-back-link:hover { color: var(--auth-text); }
.auth-back-link .icon { width: 14px; height: 14px; }

.auth-title { font-size: 1.6rem; font-weight: 800; color: var(--auth-text); letter-spacing: -.03em; margin-bottom: .25rem; }
.auth-subhead { font-size: .85rem; color: var(--auth-text-2); margin-bottom: 1.5rem; }

.auth-tabs {
  display: flex; background: var(--auth-surface); border: .5px solid var(--auth-border);
  border-radius: 12px; padding: 3px; margin-bottom: 1.5rem; gap: 2px;
}
.auth-tab {
  flex: 1; text-align: center; font-size: .82rem; font-weight: 500; color: var(--auth-text-2);
  border: none; background: none; padding: .48rem; border-radius: 9px;
  text-decoration: none; display: block; transition: all .12s;
}
.auth-tab.is-active { background: var(--auth-brand); color: #fff; font-weight: 700; }

.auth-alert { padding: .75rem 1rem; border-radius: 12px; font-size: .83rem; margin-bottom: 1rem; border: 1px solid; display: flex; gap: .5rem; align-items: flex-start; }
.auth-alert .icon { width: 16px; height: 16px; margin-top: 1px; flex-shrink: 0; }
.auth-alert-err { background: var(--auth-err-bg); border-color: var(--auth-err-border); color: var(--auth-err-text); }
.auth-alert-ok { background: var(--auth-ok-bg); border-color: var(--auth-ok-border); color: var(--auth-ok-text); }

.auth-fg { margin-bottom: .9rem; }
.auth-fg label { display: block; font-size: .78rem; font-weight: 600; color: var(--auth-text-2); margin-bottom: .3rem; }
.auth-fg .auth-input-wrap {
  display: flex; align-items: center; gap: .55rem;
  border: 1px solid var(--auth-border-strong); border-radius: 10px;
  background: var(--auth-surface); padding: 0 .8rem;
  transition: border-color .15s, box-shadow .15s;
}
.auth-fg .auth-input-wrap:focus-within { border-color: var(--auth-brand); box-shadow: 0 0 0 3px rgba(0,122,255,.12); }
.auth-fg .auth-input-wrap .icon { width: 17px; height: 17px; color: var(--auth-text-3); flex-shrink: 0; }
.auth-fg input {
  display: block; width: 100%; min-width: 0;
  padding: .65rem 0; border: none; background: transparent;
  font-size: .9rem; color: var(--auth-text); font-family: inherit;
  min-height: 44px;
}
.auth-fg input:focus { outline: none; }
.auth-icon-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex-shrink: 0;
  background: none; border: none; color: var(--auth-text-3); cursor: pointer;
}

.auth-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }

.auth-btn-main {
  display: block; width: 100%; min-height: 44px;
  padding: .72rem; background: var(--auth-brand); color: #fff;
  border: none; border-radius: 10px; font-size: .92rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: opacity .12s; margin-top: .1rem;
}
.auth-btn-main:hover { opacity: .88; }
.auth-btn-main:disabled { opacity: .5; cursor: not-allowed; }

.auth-remember-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .82rem; color: var(--auth-text-2); margin-bottom: .9rem; cursor: pointer;
}
.auth-remember-row input { width: 15px; height: 15px; accent-color: var(--auth-brand); flex-shrink: 0; }

.auth-link-row { text-align: center; margin-top: .9rem; font-size: .8rem; color: var(--auth-text-2); }
.auth-link-row a { color: var(--auth-brand); text-decoration: none; }
.auth-hint { font-size: .72rem; color: var(--auth-text-3); margin-top: .25rem; }

.auth-top-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.auth-top-row .auth-back-link { margin-bottom: 0; }

.locale-toggle { display: flex; gap: 2px; background: var(--auth-surface); border: .5px solid var(--auth-border); border-radius: 8px; padding: 2px; }
.locale-toggle a {
  font-size: .72rem; font-weight: 600; padding: .3rem .55rem; border-radius: 6px;
  text-decoration: none; color: var(--auth-text-3);
}
.locale-toggle a.is-active { background: var(--auth-brand); color: #fff; }

.auth-legal-footer { text-align: center; margin-top: 1.5rem; font-size: .75rem; color: var(--auth-text-3); }
.auth-legal-footer a { color: var(--auth-text-2); text-decoration: underline; }

@media (max-width: 700px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-panel-left { display: none; }
  .auth-panel-right { padding: 1.5rem; align-items: center; justify-content: flex-start; padding-top: 2.5rem; flex-direction: column; }
  .auth-mobile-header { display: flex; justify-content: center; margin-bottom: 1.75rem; }
  .auth-mobile-headline { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn-main { transition: none; }
}
