/* ===================================================================
   Haki App — design tokens, matched to the original shipped app's
   login screen (gradient indigo/violet, gavel mark, pill buttons).
   =================================================================== */
:root {
  --ink: #1e2247;
  --indigo: #2d2e83;
  --violet: #6b3fc9;
  --gradient: linear-gradient(135deg, #2d2e83 0%, #6b3fc9 100%);
  --bg-gradient: linear-gradient(180deg, #e4e2f5 0%, #cfd0ec 100%);
  --paper-card: #ffffff;
  --line: #d8d6ee;
  --muted: #6b6f95;
  --danger: #a8412f;

  --font-display: 'Inter', -apple-system, system-ui, sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;

  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(45, 46, 131, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-gradient);
  color: var(--ink);
  font-family: var(--font-body);
  min-height: 100vh;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  body { align-items: center; padding: 32px; }
  .shell {
    min-height: auto;
    max-width: 960px;
    flex-direction: row;
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .shell__panel {
    flex: 1;
    background: var(--gradient);
    color: #fff;
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .shell__panel .panel-mark { width: 48px; height: 48px; margin-bottom: 24px; }
  .shell__panel h2 { font-size: 2rem; line-height: 1.2; margin: 0 0 16px; font-weight: 700; }
  .shell__panel p { opacity: 0.88; line-height: 1.6; max-width: 34ch; }
  .shell__form-area { flex: 1; background: var(--bg-gradient); }
}

.topbar {
  background: var(--gradient);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1.headline {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}
.lang-toggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.form-area {
  flex: 1;
  padding: 40px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.mark-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(107, 63, 201, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.mark-circle svg { width: 52px; height: 52px; }

h2.subhead-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}
p.subhead {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 0.95rem;
}

form { display: flex; flex-direction: column; gap: 14px; width: 100%; }

.field { position: relative; text-align: left; }
.field label { position: absolute; left: -9999px; } /* visually hidden but accessible */
.field-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--indigo);
  font-size: 1.1rem;
  pointer-events: none;
}
.field input {
  width: 100%;
  padding: 16px 18px 16px 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--paper-card);
  color: var(--ink);
}
.field input:focus {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
  border-color: var(--violet);
}
.field-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--indigo);
  cursor: pointer;
  font-size: 1.1rem;
}
.field-hint { font-size: 0.78rem; color: var(--muted); margin-top: 6px; padding-left: 4px; text-align: left; }

.forgot-link {
  align-self: flex-end;
  font-size: 0.85rem;
  color: var(--violet);
  text-decoration: none;
  font-weight: 600;
  margin-top: -4px;
}

.btn-primary {
  border: none;
  background: var(--gradient);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  border: 2px solid var(--indigo);
  background: transparent;
  color: var(--indigo);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.error-banner {
  background: #fbecea;
  color: var(--danger);
  border: 1px solid #edc4bd;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  display: none;
  width: 100%;
  text-align: left;
}
.error-banner.visible { display: block; }

.disclaimer {
  margin-top: auto;
  padding-top: 24px;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.5;
}

.signup-fields { display: none; flex-direction: column; gap: 14px; width: 100%; }
.signup-fields.visible { display: flex; }

.switch-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}
.switch-hint a { color: var(--violet); font-weight: 600; text-decoration: none; cursor: pointer; }

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

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