/* =====================================================
   login.css
   Styles for the Portal login page.
   CSS variables are overwritten at runtime by login.js
   from the BRAND config defined in login.html.
===================================================== */

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

:root {
  --ink:    #0a0a0f;
  --paper:  #f5f3ee;
  --accent: #c8f135;
  --blob2:  #b8e0ff;
  --muted:  #7a7a8a;
  --border: #e0ddd5;
  --card:   #ffffff;
  --radius: 18px;
}

html, body {
  height: 100%;
  font-family: 'Manrope', sans-serif;
  background: var(--paper);
  color: var(--ink);
}

/* ── noise grain overlay ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ── blobs ── */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 520px; height: 520px;
  background: var(--accent);
  top: -160px; right: -160px;
  animation: drift 9s ease-in-out infinite alternate;
}
.blob-2 {
  width: 380px; height: 380px;
  background: var(--blob2);
  bottom: -120px; left: -100px;
  animation: drift 12s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.06); }
}

/* ── layout ── */
.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 52px 48px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 2px 4px rgba(0,0,0,.04),
    0 12px 40px rgba(0,0,0,.08),
    0 0 0 1px rgba(255,255,255,.6) inset;
  animation: rise .55s cubic-bezier(.22,.9,.36,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── logo ── */
.logo-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 36px;
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--ink);
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.logo-icon svg { display: block; }

.logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--ink);
}
.logo-sub {
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: 1px;
}

.logo-wrap .logo {
  max-width:100% !important;
}

/* ── heading ── */
h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.65rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 6px;
}
.sub {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 36px;
  font-weight: 300;
}

/* ── fields ── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  color: #bbb;
  transition: color .2s;
  pointer-events: none;
  display: flex; align-items: center;
}
input {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fafaf8;
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #c0bdb5; }
input:focus {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(10,10,15,.06);
}
.input-wrap:has(input:focus) .icon { color: var(--ink); }

/* password toggle */
.toggle-pw {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: #bbb; padding: 4px; line-height: 0;
  transition: color .2s;
}
.toggle-pw:hover { color: var(--ink); }

/* ── forgot password ── */
.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -10px;
  margin-bottom: 28px;
}
.forgot-row a {
  font-size: .82rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.forgot-row a:hover { color: var(--ink); border-color: var(--ink); }

/* ── submit button ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  height: 52px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 13px;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.btn:active { transform: translateY(0);    box-shadow: none; }

/* ripple */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  transform: scale(0);
  animation: ripple-out .5s linear;
  pointer-events: none;
}
@keyframes ripple-out { to { transform: scale(4); opacity: 0; } }

/* ── divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #c0bdb5;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── SSO button ── */
.btn-sso {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  height: 48px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn-sso:hover { border-color: #bbb; background: #fafaf8; }

/* ── card footer ── */
.card-footer {
  margin-top: 28px;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
}
.card-footer a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  transition: opacity .2s;
}
.card-footer a:hover { opacity: .6; }

/* ── pill badge ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px 3px 8px;
  border-radius: 99px;
  margin-bottom: 14px;
}
.pill-dot {
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
}

/* ── mobile ── */
@media (max-width: 480px) {
  .card { padding: 36px 24px 32px; }
}

.error { color: red; }

.success { color: green; }

/* ── inline error / success messages ── */
.field.error {
  font-size: .84rem;
  font-weight: 500;
  color: #c0392b;
  background: #fde8e8;
  border: 1px solid #f5c6c6;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.field.success {
  font-size: .84rem;
  font-weight: 500;
  color: #16a34a;
  background: #e8fdf0;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

strong { font-weight:600; }