/* ============================================================
   WebsiteSpeedy · Admin Panel · Authentication Pages
   Portal design system (Schibsted Grotesk + green brand)
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  --bg:           #F5F7F6;
  --bg-right:     #F0F4F2;
  --card:         #FFFFFF;
  --ink:          #0C1F18;
  --ink-soft:     #586A62;
  --ink-mute:     #8C9A94;
  --line:         #E3E8E5;
  --line-strong:  #CDD4D0;
  --green:        #0E9F5B;
  --green-deep:   #0A7A46;
  --green-tint:   #E8F6EF;
  --green-ink:    #06472A;
  --purple:       #6F4BD8;
  --purple-tint:  #F0EBFC;
  --amber:        #DC9A2E;
  --amber-tint:   #FDF4E1;
  --red:          #D25048;
  --red-deep:     #B73D36;
  --red-tint:     #FCECEB;
  --red-ink:      #7A2420;
  --blue:         #1A56C4;
  --blue-tint:    #E8F0FC;
  --shadow:       0 1px 3px rgba(12, 31, 24, .06);
  --shadow-md:    0 4px 16px rgba(12, 31, 24, .06);
  --radius:       12px;
  --radius-sm:    10px;
  --radius-xs:    8px;
  --font-ui:      'Schibsted Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease:         cubic-bezier(.4, 0, .2, 1);
  --duration:     0.18s;
}


/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}


/* ============================================================
   LAYOUT · split grid
   ============================================================ */
.ws-auth-wrap {
  display: grid;
  grid-template-columns: minmax(0, 760px) 1fr;
  min-height: 100vh;
}

/* ---- Left column (form) ---- */
.ws-auth-left {
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 64px;
}

/* ---- Right column (benefits / social proof) ---- */
.ws-auth-right {
  background-color: var(--bg-right);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 56px;
  border-left: 1px solid var(--line);
}

/* ---- Inner container ---- */
.ws-auth-inner {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}


/* ============================================================
   BRAND MARK
   ============================================================ */
.ws-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  text-decoration: none;
}

.ws-auth-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background-color: var(--green-tint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--duration) var(--ease);
}
.ws-auth-brand:hover .ws-auth-brand-mark {
  background-color: var(--green);
  color: #fff;
}

.ws-auth-brand-text { line-height: 1; }
.ws-auth-brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ws-auth-brand-name .spd { color: var(--green); }

.ws-auth-brand-by {
  display: inline-block;
  margin-top: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #fff;
  background-color: var(--ink);
  padding: 2px 7px;
  border-radius: 4px;
}


/* ============================================================
   HEADINGS & TEXT
   ============================================================ */
.ws-auth-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ink);
}

.ws-auth-sub {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 28px;
}


/* ============================================================
   FORM FIELDS
   ============================================================ */
.ws-auth-field { margin-bottom: 18px; }

.ws-auth-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 7px;
}
.ws-auth-label .ws-auth-optional {
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 4px;
}

.ws-auth-input,
.ws-auth-select {
  width: 100%;
  padding: 13px 14px;
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease),
              background-color var(--duration) var(--ease);
}
.ws-auth-input::placeholder { color: var(--ink-mute); }

.ws-auth-input:hover,
.ws-auth-select:hover {
  border-color: var(--line-strong);
}
.ws-auth-input:focus,
.ws-auth-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}
.ws-auth-input:focus-visible,
.ws-auth-select:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}

.ws-auth-input.is-error {
  border-color: var(--red);
  background-color: var(--red-tint);
}
.ws-auth-input.is-error:focus {
  box-shadow: 0 0 0 3px var(--red-tint);
}

.ws-auth-hint {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 7px 0 0;
  line-height: 1.4;
}

/* Select with custom chevron */
.ws-auth-select-wrap { position: relative; }
.ws-auth-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 40px;
  color: var(--ink-mute);
}
.ws-auth-select.has-value { color: var(--ink); }
.ws-auth-select-chev {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink-mute);
}


/* ============================================================
   PASSWORD FIELD
   ============================================================ */
.ws-auth-pass-wrap { position: relative; }
.ws-auth-pass-wrap .ws-auth-input { padding-right: 46px; }

.ws-auth-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration) var(--ease),
              background-color var(--duration) var(--ease);
}
.ws-auth-eye:hover {
  color: var(--ink);
  background-color: var(--green-tint);
}
.ws-auth-eye:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}


/* ============================================================
   TERMS CHECKBOX
   ============================================================ */
.ws-auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 22px;
}
.ws-auth-terms input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 4px;
}
.ws-auth-terms label {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.ws-auth-terms a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
}
.ws-auth-terms a:hover { text-decoration: underline; }
.ws-auth-terms a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ============================================================
   REMEMBER ME ROW
   ============================================================ */
.ws-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 20px;
  flex-wrap: wrap;
}

.ws-auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.ws-auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
}
.ws-auth-remember label {
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.ws-auth-inline-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.ws-auth-inline-link:hover { text-decoration: underline; }
.ws-auth-inline-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.ws-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  background-color: var(--green);
  color: #fff;
  transition: background-color var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}
.ws-auth-btn:hover {
  background-color: var(--green-deep);
}
.ws-auth-btn:active {
  transform: scale(0.985);
}
.ws-auth-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.ws-auth-btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
}
.ws-auth-btn[disabled]:hover {
  background-color: var(--green);
  transform: none;
}

.ws-auth-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.ws-auth-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  background-color: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  text-align: center;
  text-decoration: none;
  transition: border-color var(--duration) var(--ease),
              color var(--duration) var(--ease),
              background-color var(--duration) var(--ease);
}
.ws-auth-btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
  background-color: var(--green-tint);
}
.ws-auth-btn-outline:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}


/* ============================================================
   ERROR MESSAGES
   ============================================================ */
.ws-auth-error {
  font-size: 12px;
  color: var(--red);
  margin: 6px 0 0;
  display: none;
  line-height: 1.4;
}
.ws-auth-error.is-visible { display: block; }


/* ============================================================
   BANNER (form-level alerts)
   ============================================================ */
.ws-auth-banner {
  display: none;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  margin: 0 0 18px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
}
.ws-auth-banner.is-visible { display: flex; }
.ws-auth-banner svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Error banner */
.ws-auth-banner--error {
  background-color: var(--red-tint);
  border: 1px solid var(--red);
  color: var(--red-ink);
}
.ws-auth-banner--error svg { color: var(--red); }

/* Success banner */
.ws-auth-banner--success {
  background-color: var(--green-tint);
  border: 1px solid var(--green);
  color: var(--green-ink);
}
.ws-auth-banner--success svg { color: var(--green); }

/* Info banner */
.ws-auth-banner--info {
  background-color: var(--blue-tint);
  border: 1px solid var(--blue);
  color: var(--ink);
}
.ws-auth-banner--info svg { color: var(--blue); }


/* ============================================================
   ALTERNATIVE LINKS
   ============================================================ */
.ws-auth-alt {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 20px 0 0;
}
.ws-auth-alt a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.ws-auth-alt a:hover { text-decoration: underline; }
.ws-auth-alt a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ============================================================
   COPYRIGHT
   ============================================================ */
.ws-auth-copyright {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 32px 0 0;
}


/* ============================================================
   BACK LINK
   ============================================================ */
.ws-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 20px;
  padding: 4px 0;
  transition: color var(--duration) var(--ease);
}
.ws-auth-back svg {
  transition: transform var(--duration) var(--ease);
}
.ws-auth-back:hover {
  color: var(--green);
}
.ws-auth-back:hover svg {
  transform: translateX(-3px);
}
.ws-auth-back:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
  border-radius: 2px;
}


/* ============================================================
   SUCCESS STATE (email sent, password changed, etc.)
   ============================================================ */
.ws-auth-success {
  text-align: center;
  padding: 8px 0 18px;
}

.ws-auth-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background-color: var(--green-tint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ws-auth-pop 0.4s var(--ease);
}

.ws-auth-success-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}

.ws-auth-success-text {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}
.ws-auth-success-text strong { color: var(--ink); }

@keyframes ws-auth-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}


/* ============================================================
   PASSWORD STRENGTH METER
   ============================================================ */
.ws-auth-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.ws-auth-strength-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background-color: var(--line);
  overflow: hidden;
}
.ws-auth-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.3s var(--ease), background-color 0.3s var(--ease);
}

.ws-auth-strength-label {
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  min-width: 54px;
  text-align: right;
}

/* Weak */
.ws-auth-strength.is-weak .ws-auth-strength-bar span {
  width: 33%;
  background-color: var(--red);
}
.ws-auth-strength.is-weak .ws-auth-strength-label { color: var(--red); }

/* Medium */
.ws-auth-strength.is-medium .ws-auth-strength-bar span {
  width: 66%;
  background-color: var(--amber);
}
.ws-auth-strength.is-medium .ws-auth-strength-label { color: var(--amber); }

/* Strong */
.ws-auth-strength.is-strong .ws-auth-strength-bar span {
  width: 100%;
  background-color: var(--green);
}
.ws-auth-strength.is-strong .ws-auth-strength-label { color: var(--green); }


/* ============================================================
   CAPS LOCK WARNING
   ============================================================ */
.ws-auth-caps {
  font-size: 12px;
  color: var(--amber);
  margin: 7px 0 0;
  display: none;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
}
.ws-auth-caps.is-visible { display: flex; }
.ws-auth-caps svg { flex-shrink: 0; }


/* ============================================================
   reCAPTCHA CONTAINER
   ============================================================ */
.ws-auth-recaptcha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 304px;
  max-width: 100%;
  padding: 12px 14px;
  margin: 4px 0 22px;
  background-color: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow);
}
.ws-auth-recaptcha-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ws-auth-recaptcha-box {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ws-auth-recaptcha-box.is-checked {
  background-color: var(--green);
  border-color: var(--green);
  color: #fff;
}
.ws-auth-recaptcha-label { font-size: 14px; color: var(--ink); }
.ws-auth-recaptcha-brand { text-align: center; line-height: 1.1; }
.ws-auth-recaptcha-logo { font-size: 10px; color: var(--ink-soft); font-weight: 600; }
.ws-auth-recaptcha-sub { font-size: 8px; color: var(--ink-mute); }


/* ============================================================
   SPINNER (loading state inside button)
   ============================================================ */
.ws-auth-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ws-auth-spin 0.6s linear infinite;
}

@keyframes ws-auth-spin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   RIGHT PANEL · Benefits & Social Proof
   ============================================================ */
.ws-auth-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto 32px;
}

.ws-auth-benefit {
  display: flex;
  gap: 14px;
  padding: 20px;
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--duration) var(--ease),
              transform var(--duration) var(--ease);
}
.ws-auth-benefit:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ws-auth-benefit-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background-color: var(--green-tint);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-auth-benefit-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.ws-auth-benefit-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}


/* ---- Star rating ---- */
.ws-auth-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.ws-auth-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--amber);
}
.ws-auth-rating-text {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.ws-auth-rating-count {
  font-family: var(--font-mono);
  font-weight: 600;
}


/* ---- Platform logos ---- */
.ws-auth-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
  max-width: 880px;
  margin: 0 auto;
}
.ws-auth-logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-mute);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color var(--duration) var(--ease);
}
.ws-auth-logo:hover { color: var(--ink-soft); }
.ws-auth-logo svg { flex-shrink: 0; }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .ws-auth-wrap {
    grid-template-columns: 1fr;
  }
  .ws-auth-right {
    display: none;
  }
  .ws-auth-left {
    padding: 40px 28px;
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .ws-auth-left {
    padding: 32px 20px;
  }
  .ws-auth-title {
    font-size: 24px;
  }
  .ws-auth-btn-row {
    grid-template-columns: 1fr;
  }
  .ws-auth-brand-mark {
    width: 44px;
    height: 44px;
  }
  .ws-auth-brand-name {
    font-size: 17px;
  }
}


/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ws-auth-benefit:hover {
    transform: none;
  }
  .ws-auth-back:hover svg {
    transform: none;
  }
  .ws-auth-btn:active {
    transform: none;
  }
}


/* ============================================================
   FOCUS-VISIBLE GLOBAL FALLBACK
   ============================================================ */
.ws-auth-input:focus-visible,
.ws-auth-select:focus-visible,
.ws-auth-btn:focus-visible,
.ws-auth-btn-outline:focus-visible,
.ws-auth-eye:focus-visible,
.ws-auth-back:focus-visible,
.ws-auth-inline-link:focus-visible,
.ws-auth-terms a:focus-visible,
.ws-auth-alt a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}


/* ============================================================
   DARK MODE (opt-in via .ws-dark on <html>)
   ============================================================ */
.ws-dark {
  --bg:           #0F1512;
  --bg-right:     #141A16;
  --card:         #1A211D;
  --ink:          #E4ECE8;
  --ink-soft:     #A0B0A8;
  --ink-mute:     #6B7D74;
  --line:         #2A3530;
  --line-strong:  #3A4840;
  --green-tint:   rgba(14, 159, 91, 0.14);
  --green-ink:    #A2DEAD;
  --red-tint:     rgba(210, 80, 72, 0.14);
  --red-ink:      #F0A8A4;
  --blue-tint:    rgba(26, 86, 196, 0.14);
  --purple-tint:  rgba(111, 75, 216, 0.14);
  --amber-tint:   rgba(220, 154, 46, 0.14);
  --shadow:       0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md:    0 4px 16px rgba(0, 0, 0, 0.25);
}
