/* ============================================================
   Dream MS — Portal stylesheet
   Design tokens + responsive card + floating labels + tabs
   ============================================================ */

:root {
  --navy-900: #0e1b4d;
  --navy-800: #142255;
  --navy-700: #1d2f6b;
  --ink-900:  #100e17;
  --accent:   #f82249;
  --accent-2: #ff5b7b;
  --accent-soft: rgba(248, 34, 73, 0.12);
  --paper:    #ffffff;
  --paper-2:  #f7f8fc;
  --text:     #1a1f36;
  --muted:    #6b7280;
  --border:   rgba(14, 27, 77, 0.12);
  --border-strong: rgba(14, 27, 77, 0.22);
  --shadow-lg: 0 25px 50px -12px rgba(14, 27, 77, 0.45);
  --shadow-md: 0 10px 20px -8px rgba(14, 27, 77, 0.25);
  --radius:   14px;
  --radius-sm: 8px;
  --t-fast:   180ms cubic-bezier(.2,.7,.2,1);
  --t-slide:  900ms cubic-bezier(.65,0,.35,1);
}

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

html,
body {
  font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(248, 34, 73, 0.18), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(29, 47, 107, 0.55), transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--ink-900) 100%);
  background-attachment: fixed;
}

input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--accent-2);
}

/* ----------------------------------------------------------------
   Card shell
   ---------------------------------------------------------------- */

.cont {
  position: relative;
  width: min(460px, 100%);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ----------------------------------------------------------------
   Tab control — always visible at top of card
   ---------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 4px;
  margin: 16px 16px 0;
  padding: 4px;
  background: var(--paper-2);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tabs button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  transition: all var(--t-fast);
}

.tabs button[aria-selected="true"] {
  background: var(--paper);
  color: var(--navy-900);
  box-shadow: var(--shadow-md);
}

/* ----------------------------------------------------------------
   Form panes
   ---------------------------------------------------------------- */

.form {
  padding: 32px 28px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.form-logo {
  display: block;
  width: 200px;
  max-width: 60%;
  margin: 0 auto 16px;
}

.form h2 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  color: var(--navy-900);
}

/* Show only the active form, driven by data-mode */
.cont[data-mode="signin"] .sign-up,
.cont[data-mode="signup"] .sign-in { display: none; }

/* Image pane retired in compact layout */
.sub-cont { display: none; }

/* ----------------------------------------------------------------
   Floating label field
   ---------------------------------------------------------------- */

.field {
  position: relative;
  margin-bottom: 18px;
}

.field input,
.field select {
  width: 100%;
  height: 52px;
  padding: 24px 14px 8px;
  font-size: 15px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--navy-700);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(29, 47, 107, 0.12);
}

.field label {
  position: absolute;
  left: 14px;
  top: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-700);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  background: transparent;
  transition: color var(--t-fast);
}

.field .hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.field[data-invalid="true"] input,
.field[data-invalid="true"] select {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Password show/hide */
.field--password input { padding-right: 44px; }
.toggle-password {
  position: absolute;
  right: 8px;
  top: 8px;            /* (input 52px - button 36px) / 2, anchored to input not .field */
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 50%;
  transition: background var(--t-fast), color var(--t-fast);
}
.toggle-password:hover { background: var(--paper-2); color: var(--navy-700); }
.toggle-password svg { width: 18px; height: 18px; }

/* Birthday row — keep the 3-select fallback usable */
.field--birthday select {
  height: 44px;
  padding: 8px 10px;
  margin-right: 6px;
  width: auto;
}
.field--birthday .selects {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.field--birthday .selects select {
  flex: 1;
  min-width: 90px;
}

/* ----------------------------------------------------------------
   Submit button (brand red)
   ---------------------------------------------------------------- */

.submit {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 0;
  padding: 0 24px;
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(248, 34, 73, 0.55);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}

.submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -10px rgba(248, 34, 73, 0.65);
}

.submit:active {
  transform: translateY(0);
}

/* ----------------------------------------------------------------
   Alerts — inline error band, replaces the Bootstrap alert look
   ---------------------------------------------------------------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.45;
  border-left: 4px solid;
}

.alert strong { font-weight: 700; margin-right: 4px; }

.alert-danger {
  color: #8a1230;
  background: var(--accent-soft);
  border-color: var(--accent);
}

.alert-success {
  color: #0f5132;
  background: rgba(25, 135, 84, 0.10);
  border-color: #198754;
}

.alert-warning {
  color: #6b4a00;
  background: rgba(255, 193, 7, 0.12);
  border-color: #ffc107;
}

.alert-info {
  color: #084298;
  background: rgba(13, 110, 253, 0.10);
  border-color: #0d6efd;
}

/* ----------------------------------------------------------------
   Terms / fine print
   ---------------------------------------------------------------- */

.fineprint {
  margin: 12px 0 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* Terms of Use consent checkbox */
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0 18px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.terms-check:hover {
  border-color: var(--border-strong);
}

.terms-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.terms-check__box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--paper);
  display: grid;
  place-items: center;
  color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.terms-check__box svg {
  width: 12px;
  height: 12px;
}

.terms-check input:checked + .terms-check__box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.terms-check input:focus-visible + .terms-check__box {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.terms-check__text { flex: 1; }
.terms-check__text a { font-weight: 600; }

.center { text-align: center; }

/* hCaptcha — keep it from overflowing on narrow screens */
.h-captcha {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
  transform-origin: center;
}

@media (max-width: 360px) {
  .h-captcha { transform: scale(0.85); }
}

/* ----------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
