/**
 * auth.css — KrooIM-branded split-screen login page (auth/login.php only).
 * Shares the same design-token approach as landing.css but is loaded independently since
 * the login page has always had its own standalone <html> head (not includes/header.php).
 */

:root {
  --au-primary-500: #6366f1;
  --au-primary-600: #4f46e5;
  --au-primary-700: #4338ca;
  --au-accent: #06b6d4;
  --au-bg: #f8fafc;
  --au-surface: #ffffff;
  --au-surface-2: #f1f5f9;
  --au-border: #e5e7eb;
  --au-text: #0f172a;
  --au-text-muted: #64748b;
  --au-radius: 18px;
  --au-radius-lg: 24px;
  --au-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.12), 0 2px 8px -2px rgba(15, 23, 42, 0.06);
  --au-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] {
  /* โทนกรมท่า/darkblue อิง #00083d แทนโทนดำ/เทาเดิม */
  --au-bg: #00083d;
  --au-surface: #0d1660;
  --au-surface-2: #142074;
  --au-border: #223a8f;
  --au-text: #eef1ff;
  --au-text-muted: #a3ade0;
}

/* Locked to the viewport height on desktop (992px+) so the split-screen never needs a page scrollbar;
   each panel gets its own overflow-y:auto as a safety net only for unusually short/zoomed viewports.
   Below 992px the brand panel is hidden anyway, so the form-only page scrolls normally like any page. */
body.au-body { font-family: 'Prompt', 'Sarabun', sans-serif; background: var(--au-bg); color: var(--au-text); min-height: 100vh; }
.au-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) {
  .au-shell { grid-template-columns: 1.05fr 1fr; height: 100vh; }
  .au-brand-panel, .au-form-panel { height: 100vh; overflow-x: hidden; overflow-y: auto; }
}

/* ---------- Top bar (theme toggle) ---------- */
.au-topbar { position: absolute; top: 0; right: 0; padding: 1.25rem; z-index: 10; display: flex; gap: 0.5rem; }
.au-icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--au-surface); border: 1px solid var(--au-border); color: var(--au-text); cursor: pointer;
  transition: background-color .2s var(--au-ease), transform .2s var(--au-ease);
}
.au-icon-btn:hover { background: var(--au-surface-2); transform: translateY(-2px); }
.au-shell :where(a) { color: inherit; }
.au-shell :focus-visible { outline: 2px solid var(--au-primary-500); outline-offset: 2px; border-radius: 6px; }

/* ---------- Left brand panel — real photo background, content anchored to bottom over a dark scrim ---------- */
.au-brand-panel {
  position: relative; display: none; flex-direction: column; justify-content: flex-end;
  background-color: #1e1b4b; background-size: cover; background-position: center;
  padding: 2rem 2.75rem;
}
@media (min-width: 992px) { .au-brand-panel { display: flex; } }
.au-brand-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(30, 27, 75, 0.55) 55%, rgba(17, 15, 45, 0.9) 100%);
}
.au-brand-content { position: relative; z-index: 1; color: #fff; }

.au-brand-logo { display: flex; align-items: center; gap: 0.75rem; }
.au-brand-logo-badge {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.au-brand-name { font-weight: 700; font-size: 0.95rem; color: #fff; }
.au-brand-sub { font-size: 0.72rem; color: rgba(255, 255, 255, 0.7); }

.au-hero-title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.25; color: #fff; margin-top: 1.1rem; }
.au-hero-title .au-hero-brand {
  display: block; font-size: clamp(2rem, 3.4vw, 2.7rem);
  background: linear-gradient(120deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.au-hero-desc { color: rgba(255, 255, 255, 0.82); margin-top: 0.6rem; max-width: 28rem; line-height: 1.6; font-size: 0.92rem; }

/* ---------- Feature highlights (replaces the old abstract KrooIM Model diagram) ---------- */
.au-feature-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.4rem; }
.au-feature-item { display: flex; align-items: center; gap: 0.85rem; }
.au-feature-icon {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1rem;
}
.au-feature-text { font-size: 0.86rem; font-weight: 500; color: rgba(255, 255, 255, 0.95); }

.au-footer-mini { margin-top: 1.4rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; color: rgba(255, 255, 255, 0.55); position: relative; z-index: 1; }
.au-footer-mini nav { display: flex; gap: 1rem; }
.au-footer-mini a { color: rgba(255, 255, 255, 0.55); }
.au-footer-mini a:hover { color: #fff; }

/* ---------- Right form panel ---------- */
.au-form-panel { display: flex; align-items: center; justify-content: center; padding: 1.5rem; position: relative; }
.au-form-card { width: 100%; max-width: 26rem; }
.au-form-logo {
  width: 54px; height: 54px; border-radius: 999px; margin: 0 auto 0.75rem;
  background: var(--au-surface); box-shadow: var(--au-shadow); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--au-border);
}
.au-form-logo-mark {
  font-family: 'Prompt', sans-serif; font-weight: 800; font-size: 1.6rem;
  background: linear-gradient(135deg, var(--au-primary-600), var(--au-accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.au-brand-logo-badge img,
.au-brand-logo-badge.au-badge-img { object-fit: cover; }
.au-input-password { padding-right: 2.6rem; }
.au-form-title { text-align: center; font-size: 1.25rem; font-weight: 700; color: var(--au-text); }
.au-form-subtitle { text-align: center; font-size: 0.85rem; color: var(--au-text-muted); margin-top: 0.2rem; margin-bottom: 1.1rem; }

.au-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--au-text); margin-bottom: 0.4rem; }
.au-field-wrap { position: relative; }
.au-field-icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--au-text-muted); pointer-events: none; }
.au-input {
  width: 100%; padding: 0.8rem 0.9rem 0.8rem 2.6rem; border-radius: 12px; border: 1px solid var(--au-border);
  background: var(--au-surface); color: var(--au-text); font: inherit; transition: border-color .2s var(--au-ease), box-shadow .2s var(--au-ease);
}
.au-input:focus { outline: 0; border-color: var(--au-primary-500); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.au-field-toggle { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--au-text-muted); background: none; border: 0; cursor: pointer; padding: 0.25rem; }
.au-field-toggle:hover { color: var(--au-text); }

.au-row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.85rem; }
.au-checkbox { display: flex; align-items: center; gap: 0.45rem; color: var(--au-text-muted); }
.au-checkbox input { width: 16px; height: 16px; accent-color: var(--au-primary-600); }
.au-link { color: var(--au-primary-600); font-weight: 500; text-decoration: none; }
.au-link:hover { text-decoration: underline; }

.au-btn-submit {
  width: 100%; padding: 0.9rem; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--au-primary-600), var(--au-primary-700)); color: #fff; font-weight: 700; font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, 0.5);
  transition: transform .2s var(--au-ease), box-shadow .2s var(--au-ease);
}
.au-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -8px rgba(79, 70, 229, 0.55); }

.au-alert { border-radius: 12px; padding: 0.7rem 1rem; font-size: 0.85rem; margin-bottom: 1rem; border: 1px solid; }
.au-alert-danger { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.3); color: #b91c1c; }
.au-alert-warning { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.3); color: #b45309; }
[data-theme="dark"] .au-alert-danger { color: #fca5a5; }
[data-theme="dark"] .au-alert-warning { color: #fcd34d; }

.au-help-line { text-align: center; font-size: 0.8rem; color: var(--au-text-muted); margin-top: 1.1rem; }
.au-help-line i { color: var(--au-primary-600); }
