/*
 * Sign-in page (system/auth/login.blade.php).
 * Standalone on purpose: it does not load the Beagle admin theme, so nothing here
 * leaks into or depends on the rest of the app.
 */

:root {
  /* Brand: World Citi Group indigo, sampled from assets/logo.png */
  --brand-950: #11134a;
  --brand-900: #171a5c;
  --brand-800: #1f2378;
  --brand-700: #2b2f96; /* primary actions */
  --brand-600: #3a3fb0;
  --brand-100: #e4e5f6;
  --brand-50:  #f3f3fc;

  /* Neutrals, tinted toward the brand hue */
  --ink-900: #1b1d2e; /* headings, body */
  --ink-700: #44475e;
  --ink-600: #5d6077; /* secondary text, 6.3:1 on white */
  --ink-500: #8a8da3; /* input borders, 3.2:1 on white */
  --ink-200: #dfe0ea;
  --ink-100: #eceef4;
  --surface: #ffffff;
  --canvas:  #f5f6fa;

  /* Feedback */
  --danger-700: #b42318; --danger-50: #fef3f2; --danger-200: #fecdca;
  --success-700: #067647; --success-50: #ecfdf3; --success-200: #abefc6;
  --warning-700: #93370d; --warning-50: #fffaeb; --warning-200: #fedf89;
  --info-700: #1f2378;   --info-50: #f3f3fc;    --info-200: #c9cbf0;

  /* Type scale (px): 13 / 14 / 16 / 20 / 28 / 36 */
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;

  /* Spacing scale (px): 4 8 12 16 24 32 48 64 */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-6: 1.5rem;  --s-8: 2rem;   --s-12: 3rem;   --s-16: 4rem;

  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(23, 26, 92, 0.06), 0 12px 32px -8px rgba(23, 26, 92, 0.18);
  --focus-ring: 0 0 0 3px rgba(58, 63, 176, 0.35);

  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Brand panel ---------- */

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--s-12) var(--s-16);
  color: #fff;
  background:
    radial-gradient(120% 90% at 0% 0%, var(--brand-700) 0%, transparent 60%),
    linear-gradient(160deg, var(--brand-800) 0%, var(--brand-950) 100%);
}

/* Concentric arcs echoing the logo's swirl - purely decorative */
.auth-brand__art {
  position: absolute;
  right: -180px;
  bottom: -180px;
  width: 620px;
  height: 620px;
  pointer-events: none;
  opacity: 0.9;
}

.auth-brand__top,
.auth-brand__body,
.auth-brand__foot { position: relative; }

.auth-brand__org {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9cbf0; /* 9.7:1 on brand-800 */
}

.auth-brand__title {
  margin: 0 0 var(--s-4);
  max-width: 14ch;
  font-size: var(--text-2xl);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-brand__lead {
  margin: 0 0 var(--s-8);
  max-width: 42ch;
  font-size: var(--text-md);
  color: #d6d7f3;
}

.auth-brand__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--s-4);
}

.auth-brand__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-size: var(--text-sm);
  color: #e9e9fa;
}

.auth-brand__list svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: #a9acec;
}

.auth-brand__list strong {
  display: block;
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
}

.auth-brand__foot {
  margin: 0;
  font-size: var(--text-xs);
  color: #b8baea;
}

/* ---------- Form panel ---------- */

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-12) var(--s-6);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: var(--s-12) var(--s-8) var(--s-8);
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.auth-card__logo {
  display: block;
  width: 132px;
  height: auto;
  margin: 0 auto var(--s-6);
}

.auth-card__title {
  margin: 0 0 var(--s-1);
  text-align: center;
  font-size: var(--text-xl);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-card__subtitle {
  margin: 0 0 var(--s-8);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-600);
}

.auth-help {
  margin: var(--s-6) 0 0;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-600);
}

.auth-help strong { color: var(--ink-700); font-weight: 600; }

/* ---------- Alerts ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin: 0 0 var(--s-6);
  padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  font-size: var(--text-sm);
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.alert__text { flex: 1; }
.alert__text strong { font-weight: 600; }

.alert--danger  { color: var(--danger-700);  background: var(--danger-50);  border-color: var(--danger-200); }
.alert--success { color: var(--success-700); background: var(--success-50); border-color: var(--success-200); }
.alert--warning { color: var(--warning-700); background: var(--warning-50); border-color: var(--warning-200); }
.alert--info    { color: var(--info-700);    background: var(--info-50);    border-color: var(--info-200); }

.alert__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -4px 0;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.75;
}
.alert__close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.alert__close:focus-visible { outline: none; box-shadow: var(--focus-ring); opacity: 1; }
.alert__close svg { width: 16px; height: 16px; margin: 0; }

/* ---------- Fields ---------- */

.field { margin-bottom: var(--s-6); }

.field__label {
  display: block;
  margin-bottom: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-900);
}

.field__control { position: relative; }

.field__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ink-600);
  pointer-events: none;
}

.field__input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 var(--s-4) 0 44px;
  font: inherit;
  font-size: var(--text-md);
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--ink-500);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input--password { padding-right: 52px; }

.field__input:hover { border-color: var(--ink-700); }

.field__input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: var(--focus-ring);
}

.field__input:focus + .field__icon,
.field__control:focus-within .field__icon { color: var(--brand-700); }

.field__input:disabled { background: var(--ink-100); color: var(--ink-600); cursor: not-allowed; }

.field--error .field__input { border-color: var(--danger-700); }
.field--error .field__input:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.25); }

/* Show/hide password */
.field__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  padding: 0;
  color: var(--ink-600);
  background: none;
  border: 0;
  border-radius: 6px;
  transform: translateY(-50%);
  cursor: pointer;
}
.field__toggle:hover { color: var(--ink-900); background: var(--ink-100); }
.field__toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); color: var(--brand-700); }
.field__toggle svg { width: 20px; height: 20px; }
.field__toggle .icon-hide { display: none; }
.field__toggle[aria-pressed="true"] .icon-show { display: none; }
.field__toggle[aria-pressed="true"] .icon-hide { display: block; }

.field__hint {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin: var(--s-2) 0 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--warning-700);
}
.field__hint svg { width: 14px; height: 14px; flex: none; }
.field__hint[hidden] { display: none; }

/* ---------- Remember me ---------- */

.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 44px;
  margin: calc(var(--s-2) * -1) 0 var(--s-4);
  font-size: var(--text-sm);
  color: var(--ink-700);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand-700);
  cursor: pointer;
}

.check input:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }

/* ---------- Primary button ---------- */

.btn-primary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  height: 48px;
  padding: 0 var(--s-6);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 600;
  color: #fff;
  background: var(--brand-700);
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(17, 19, 74, 0.2);
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover { background: var(--brand-800); }
.btn-primary:active { background: var(--brand-900); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand-600); }
.btn-primary:disabled { cursor: progress; background: var(--brand-800); }

.btn-primary__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-primary.is-loading .btn-primary__spinner { display: inline-block; }

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

/* ---------- Page footer (form side) ---------- */

.auth-legal {
  margin: var(--s-8) 0 0;
  font-size: var(--text-xs);
  color: var(--ink-600);
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 60em) { /* 960px */
  .auth-brand { padding: var(--s-12) var(--s-8); }
  .auth-brand__title { font-size: var(--text-xl); }
}

@media (max-width: 48em) { /* 768px: single column, brand panel becomes a slim header */
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .auth-brand {
    padding: var(--s-6);
  }
  .auth-brand__body,
  .auth-brand__foot,
  .auth-brand__art { display: none; }

  .auth-main {
    justify-content: flex-start;
    padding: 0 var(--s-4) var(--s-8);
  }

  .auth-card {
    position: relative; /* paint above the (positioned) brand header it overlaps */
    margin-top: calc(var(--s-4) * -1);
    padding: var(--s-8) var(--s-6) var(--s-6);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}
