/* ==========================================================
   Lokvidya — Login
========================================================== */

:root {
  --brand:        #1e3a8a;
  --brand-700:    #1c3577;
  --brand-500:    #2563eb;
  --accent:       #3b82f6;

  --ink:          #0f172a;
  --ink-2:        #475569;
  --ink-3:        #94a3b8;

  --line:         #e2e8f0;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;

  --danger:       #b91c1c;
  --danger-bg:    #fef2f2;
  --danger-line:  #fecaca;

  --radius:       10px;
  --radius-lg:    14px;

  --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md:    0 4px 12px rgba(15, 23, 42, .08);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.auth-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

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

.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 60px;
  color: #fff;
  background:
    radial-gradient(900px 600px at 15% 15%, rgba(59, 130, 246, .35), transparent 60%),
    radial-gradient(700px 500px at 85% 90%, rgba(14, 165, 233, .28), transparent 60%),
    linear-gradient(160deg, #16296b 0%, #1e3a8a 45%, #14245e 100%);
}

/* Subtle grid texture — reads as "engineered", not decorative */
.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 75%);
  pointer-events: none;
}

.brand-panel__inner,
.brand-panel__foot { position: relative; z-index: 1; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}

.brand-mark__glyph {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  font-family: "Noto Sans Devanagari", var(--font);
  font-size: 24px;
  line-height: 1;
  font-weight: 600;
}

.brand-mark__text {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.brand-panel__title {
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: 18px;
  max-width: 12ch;
}

.brand-panel__lead {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .78);
  max-width: 46ch;
  margin-bottom: 36px;
}

.brand-panel__features {
  list-style: none;
  display: grid;
  gap: 14px;
}

.brand-panel__features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, .88);
}

.brand-panel__features i {
  color: #7dd3fc;
  font-size: 15px;
}

.brand-panel__foot {
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
}

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

.form-panel {
  display: grid;
  place-items: center;
  padding: 48px 40px;
  background: var(--surface);
}

.form-panel__inner {
  width: 100%;
  max-width: 400px;
  animation: rise .45s cubic-bezier(.16, 1, .3, 1);
}

.form-panel__mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  color: var(--brand);
}

.form-panel__mobile-brand .brand-mark__glyph {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.form-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 8px;
}

.form-subtitle {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 32px;
}

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

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 7px;
}

.field__control { position: relative; }

.field__control input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.field__control input::placeholder { color: var(--ink-3); }

.field__control input:hover { border-color: #cbd5e1; }

.field__control input:focus {
  background: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.field__icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--ink-3);
  pointer-events: none;
  transition: color .15s;
}

.field__control:focus-within .field__icon { color: var(--brand-500); }

.field__toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.field__toggle:hover { color: var(--ink-2); background: #eef2f7; }

.field__toggle:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
}

/* ---------- Error ---------- */

.form-error {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--danger);
  min-height: 0;
  margin-bottom: 4px;
}

.form-error:not(:empty) {
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-line);
  border-radius: 8px;
}

/* ---------- Button ---------- */

.btn-primary {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .18s, transform .12s, box-shadow .18s;
}

.btn-primary i {
  font-size: 13px;
  transition: transform .18s;
}

.btn-primary:hover {
  background: var(--brand-700);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover i { transform: translateX(3px); }

.btn-primary:active { transform: translateY(1px); }

.btn-primary:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

/* ---------- Helper ---------- */

.form-help {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- Motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

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

@media (max-width: 980px) {
  .auth-layout { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .form-panel__mobile-brand { display: flex; }
  .form-panel { min-height: 100vh; }
}

@media (max-width: 480px) {
  .form-panel { padding: 32px 22px; }
  .form-title { font-size: 24px; }
}
