/**
 * Login screen — branded split card.
 *
 * Self-contained: does not inherit app.css, so the branded gradient look stays
 * identical regardless of the viewer's light/dark preference. The dashboard
 * still uses app.css and remains theme-aware.
 */

* { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #1e293b;
  background: linear-gradient(135deg, #6f7ae4 0%, #7c6fdc 50%, #8b6bd4 100%);
  display: grid;
  place-items: center;
  padding: 28px 20px;
}

.auth-card {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 70px rgba(30, 27, 75, .32);
}

/* ---------------- Brand panel (left) ---------------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 44px 40px;
  color: #fff;
  background: linear-gradient(150deg, #6d7ce6 0%, #7d6cdb 100%);
  display: flex;
  flex-direction: column;
}

/* Decorative circles, purely ornamental. */
.auth-brand::before,
.auth-brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  pointer-events: none;
}
.auth-brand::before { width: 260px; height: 260px; top: -110px; right: -70px; }
.auth-brand::after  { width: 220px; height: 220px; bottom: -110px; left: -80px; }

.auth-brand > * { position: relative; z-index: 1; }

.brand-mark {
  width: 46px; height: 46px;
  margin-bottom: 22px;
  color: #f43f5e;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }

.auth-brand h1 {
  margin: 0 0 12px;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
}
.auth-brand .lede {
  margin: 0 0 26px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  max-width: 42ch;
}

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feature {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .10);
}
.feature-icon {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
}
.feature-icon svg { width: 19px; height: 19px; }
.feature b { display: block; font-size: 14px; font-weight: 700; }
.feature span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .75); }

/* ---------------- Form panel (right) ---------------- */
.auth-form {
  padding: 44px 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

.auth-form h2 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  color: #1e293b;
}
.auth-form .sub {
  margin: 0 0 22px;
  text-align: center;
  font-size: 13.5px;
  color: #64748b;
}

/* Segmented role selector */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 12px;
  background: #f1f5f9;
  margin-bottom: 22px;
}
.seg {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px;
  border: 0; border-radius: 9px;
  background: transparent;
  color: #64748b;
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg svg { width: 16px; height: 16px; }
.seg:hover { color: #475569; }
.seg[aria-selected="true"] {
  background: linear-gradient(135deg, #6f6ae0, #8a63d2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(111, 106, 224, .35);
}

/* Fields */
.field { margin-bottom: 15px; }
.field > label {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 7px;
  font-size: 13px; font-weight: 700; color: #334155;
}
.field > label svg { width: 14px; height: 14px; color: #64748b; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .lead {
  position: absolute; left: 13px;
  width: 16px; height: 16px;
  color: #94a3b8; pointer-events: none;
}
.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #1e293b;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input-wrap input::placeholder { color: #94a3b8; }
.input-wrap input:focus {
  background: #fff;
  border-color: #7c6fdc;
  box-shadow: 0 0 0 3px rgba(124, 111, 220, .18);
}
.input-wrap input:disabled { opacity: .6; cursor: not-allowed; }

/* Password reveal */
.reveal {
  position: absolute; right: 8px;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 0; border-radius: 8px;
  background: transparent; color: #94a3b8;
  cursor: pointer;
}
.reveal:hover { color: #475569; background: #f1f5f9; }
.reveal svg { width: 17px; height: 17px; }
/* The [hidden] attribute does not reliably suppress SVG children here, so both
   eye states would render stacked. Hide explicitly. */
.reveal svg[hidden] { display: none; }

/* Row: remember / forgot */
.form-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 16px 0 20px;
}
.remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #475569; cursor: pointer; user-select: none;
}
.remember input {
  width: 15px; height: 15px; margin: 0;
  accent-color: #7c6fdc; cursor: pointer;
}
.link {
  background: none; border: 0; padding: 0;
  font: inherit; font-size: 13px; color: #6f6ae0;
  cursor: pointer; text-decoration: none;
}
.link:hover { text-decoration: underline; }

/* Submit */
.auth-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  padding: 13px 18px;
  border: 0; border-radius: 11px;
  background: linear-gradient(135deg, #6f6ae0, #8a63d2);
  color: #fff;
  font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(111, 106, 224, .32);
  transition: filter .15s, transform .05s, box-shadow .15s;
}
.auth-btn svg { width: 17px; height: 17px; }
.auth-btn:hover:not(:disabled) { filter: brightness(1.07); }
.auth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-btn:disabled { opacity: .65; cursor: not-allowed; box-shadow: none; }

/* Notices */
.notice {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.notice svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.notice[hidden] { display: none; }
.notice-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.notice-info  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

.foot {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
}
.foot + .foot { margin-top: 5px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .auth-card { grid-template-columns: 1fr; max-width: 460px; }
  /* The brand panel is decorative; the form is the task. Drop the feature
     list on small screens rather than pushing the form below the fold. */
  .auth-brand { padding: 30px 28px; }
  .auth-brand h1 { font-size: 24px; }
  .auth-brand .lede { margin-bottom: 0; }
  .features { display: none; }
  .auth-form { padding: 32px 28px; }
}

@media (max-width: 420px) {
  .auth-form { padding: 26px 20px; }
  .seg { font-size: 12.5px; gap: 5px; }
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
