/* ============================================================
   Eimi LMS — Modern Auth Pages (Login & Register)
   Clean Apple / Linear Aesthetic · Slate Neutrals · Precision Form Fields
   ============================================================ */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --paper: #f8fafc;
  --paper-2: #ffffff;
  --coral: #ea384c;
  --coral-hover: #cf2438;
  --coral-soft: rgba(234, 56, 76, 0.09);
  --teal: #0284c7;
  --teal-soft: rgba(2, 132, 199, 0.09);
  --line: rgba(15, 23, 42, 0.1);
  --line-strong: rgba(15, 23, 42, 0.18);
  --muted: #94a3b8;
  --danger: #e11d48;
  --danger-bg: #fff1f2;
  --radius-xs: 6px;
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 18px;
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input {
  font: inherit;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--coral);
}

button {
  cursor: pointer;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  background: var(--ink);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-s);
  z-index: 30;
  font-weight: 600;
  transition: top 0.2s;
}

.skip:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* Layout */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
}

/* Story Left Panel */
.story {
  background: #090d16;
  color: #ffffff;
  padding: 36px clamp(32px, 5vw, 84px) 34px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.story::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 50%, rgba(2, 132, 199, 0.16), transparent 50%),
              radial-gradient(circle at 10% 90%, rgba(234, 56, 76, 0.12), transparent 45%);
  pointer-events: none;
}

.brand, .story-content, .story-bottom {
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand svg {
  width: 32px;
  height: 32px;
}

.brand span {
  color: var(--coral);
}

.story-content {
  margin: auto 0;
  max-width: 640px;
  padding: 48px 0 40px;
}

.eyebrow, .section-no, .form-kicker, .story-bottom {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.eyebrow {
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  background: var(--coral);
  border-radius: 99px;
}

.story h1 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(40px, 5vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 700;
  margin: 22px 0 20px;
  max-width: 700px;
  color: #ffffff;
}

.story h1 em {
  font-style: normal;
  color: var(--coral);
}

.story-desc {
  max-width: 480px;
  color: #94a3b8;
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0;
}

.network {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 40px 0 0;
  overflow: visible;
}

.network path {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
  fill: none;
}

.network circle {
  fill: #64748b;
}

.network circle.accent {
  fill: var(--coral);
}

.network circle.teal {
  fill: var(--teal);
}

.network text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  fill: #94a3b8;
  letter-spacing: 0.08em;
}

.story-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

/* Auth Panel Right */
.auth-panel {
  display: flex;
  flex-direction: column;
  padding: 34px clamp(28px, 5vw, 68px) 30px;
  background: var(--paper);
}

.panel-top {
  display: flex;
  justify-content: flex-end;
  font-size: 13.5px;
  color: var(--ink-3);
}

.panel-top a {
  font-weight: 600;
  color: var(--teal);
  margin-left: 4px;
}

.form-wrap {
  margin: auto 0;
  max-width: 440px;
  width: 100%;
  padding: 32px 0;
}

.form-kicker {
  color: var(--teal);
  margin-bottom: 12px;
}

.form-wrap h2 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 10px;
}

.form-wrap .intro {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 26px;
}

/* Form Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 14px;
  outline: 0;
  transition: all var(--transition);
}

.field input::placeholder {
  color: var(--muted);
}

.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field-note {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.5;
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 64px;
}

.reveal {
  position: absolute;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color var(--transition);
}

.reveal:hover {
  color: var(--coral);
}

.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: var(--radius-s);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 4px;
}

.error[hidden] {
  display: none;
}

/* Submit Button */
.submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--coral);
  border-radius: var(--radius-s);
  background: var(--coral);
  color: #ffffff;
  font: 600 14px 'Space Grotesk', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 14px -2px rgba(234, 56, 76, 0.3);
  margin-top: 6px;
}

.submit:hover {
  background: var(--coral-hover);
  border-color: var(--coral-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px -2px rgba(234, 56, 76, 0.4);
}

.submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.submit svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
}

.switch {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 22px 0 0;
  text-align: center;
}

.switch a {
  font-weight: 600;
  color: var(--teal);
}

.panel-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

/* Responsive */
@media (max-width: 950px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .story {
    min-height: 0;
    padding: 30px clamp(24px, 6vw, 60px) 28px;
  }
  .story-content {
    padding: 28px 0 10px;
    margin: 0;
  }
  .story h1 {
    font-size: clamp(34px, 7vw, 56px);
    margin: 14px 0;
  }
  .story-desc {
    font-size: 14px;
  }
  .network, .story-bottom {
    display: none;
  }
  .auth-panel {
    padding: 28px clamp(24px, 6vw, 60px) 32px;
  }
  .form-wrap {
    padding: 24px 0;
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  .form-wrap h2 {
    font-size: 28px;
  }
  .auth-panel {
    padding: 20px 20px 24px;
  }
  .panel-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
