/*
  Dovent auth pages — design concept
  -----------------------------------
  Subject: a Bangladeshi savings/investment app. The visual idea is "growth":
  a dark indigo-navy panel carrying the brand and a rising-bars mark, paired
  with a plain, quiet form panel. Inputs are underlined rather than boxed, so
  the page doesn't read as a generic bordered-card form. One accent color
  (warm gold, standing for value/growth) is spent only on the button, the
  focus state, and the bars — everything else stays ink/mist/white.
*/

:root {
  --ink: #0f1730;
  --ink-soft: #565f7c;
  --paper: #ffffff;
  --mist: #f3f5fb;
  --line: #dde1ee;
  --accent: #e2a83a;
  --accent-dark: #c78f26;
  --accent-tint: #fbead0;
  --error-bg: #fdecea;
  --error-text: #b3261e;
  --ok-bg: #e7f6ee;
  --ok-text: #1c6b47;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto,
    "Noto Sans Bengali", Arial, sans-serif;
  color: var(--ink);
  background: var(--mist);
  line-height: 1.6;
}

/* ---------- layout shell ---------- */

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
}

/* ---------- brand panel (left) ---------- */

.brand-panel {
  background: var(--ink);
  color: #eef0f8;
  display: flex;
  align-items: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.brand-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 320px;
}

.wordmark {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 96px;
  margin: 36px 0 28px;
}

.bars span {
  display: block;
  width: 14px;
  border-radius: 3px 3px 0 0;
  background: var(--accent);
  animation: rise 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.bars span:nth-child(1) { height: 34%; animation-delay: 0ms; }
.bars span:nth-child(2) { height: 55%; animation-delay: 60ms; }
.bars span:nth-child(3) { height: 40%; animation-delay: 120ms; }
.bars span:nth-child(4) { height: 78%; animation-delay: 180ms; }
.bars span:nth-child(5) { height: 100%; animation-delay: 240ms; }

@keyframes rise {
  from {
    transform: scaleY(0);
    transform-origin: bottom;
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    transform-origin: bottom;
    opacity: 1;
  }
}

.pitch {
  margin: 0;
  color: #c7cbe0;
  font-size: 15px;
}

/* ---------- form panel (right) ---------- */

.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.form-panel-inner {
  width: 100%;
  max-width: 360px;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- message banner ---------- */

.message {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.message.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.message.success {
  background: var(--ok-bg);
  color: var(--ok-text);
}

/* Referral checkpoint: used by register.html's #referral-banner to show
   "আমন্ত্রণ কোড প্রয়োগ হবে: XXXX" when the page was opened via a referral
   link. Purely informational (not an error/success state), so it gets its
   own neutral-but-noticeable color using the existing accent tokens rather
   than reusing .error/.success's red/green. */
.message.info {
  background: var(--accent-tint);
  color: var(--accent-dark);
  border: 1px solid var(--accent);
}

/* ---------- form fields ---------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 20px 0 8px;
}

label:first-of-type {
  margin-top: 0;
}

input[type="text"],
input[type="tel"],
input[type="password"] {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--line);
  padding: 10px 2px;
  transition: border-color 150ms ease;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

input::placeholder {
  color: #a7acc4;
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--line);
  transition: border-color 150ms ease;
}

.phone-row:focus-within {
  border-bottom-color: var(--accent);
}

.phone-row .prefix {
  font-weight: 600;
  color: var(--ink-soft);
  padding: 10px 0;
}

.phone-row input {
  border-bottom: none !important;
  flex: 1;
}

.hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 400;
}

.checkbox input {
  accent-color: var(--accent-dark);
  width: 16px;
  height: 16px;
}

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

button {
  width: 100%;
  margin-top: 28px;
  padding: 13px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:focus-visible {
  outline: 3px solid var(--accent-dark);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

/* ---------- switch link (register <-> login) ---------- */

.switch {
  margin: 20px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.switch a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.switch a:hover {
  color: var(--accent-dark);
}

/* ---------- responsive: stack on narrow screens ---------- */

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    padding: 28px 24px;
  }

  .brand-panel-inner {
    max-width: none;
  }

  .bars {
    height: 56px;
    margin: 18px 0 16px;
  }

  .bars span {
    width: 10px;
  }

  .pitch {
    font-size: 14px;
  }

  .form-panel {
    padding: 36px 24px 56px;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .bars span {
    animation: none;
  }
}

/* ---------- solid mint form side (no gradients) ---------- */

.form-panel { background: #d6efe3; }
.form-panel-inner input[type="text"],
.form-panel-inner input[type="password"],
.phone-row { background: #ffffff; border-color: #bfe0cf; }
.hint { color: #3f6b58; }
