/* SSMA — shared design system (register + login)
   Visual reference: the two screenshots supplied by the user.
   Dark background + faint grid, cream pills, brown gradient button.
   No screenshot is used as a background image: everything is real HTML/CSS. */

:root {
  --bg: #060504;
  --bg-warm: #1a120a;
  --pill: #f6f3ec;
  --pill-text: #1c140d;
  --placeholder: #8f8a80;
  --icon: #6d4a30;
  --title: #ffffff;
  --muted: #cfc7b8;
  --muted-2: #b8b0a0;
  --btn-top: #7e4a2a;
  --btn-mid: #5e331d;
  --btn-bottom: #452412;
  --error: #ffb3a7;
  --radius-pill: 18px;
  --radius-btn: 16px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #000;
  color: var(--title);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: clip;
}

/* Full-page dark stage. The phone column sits centred on wide screens,
   so the page never stretches into a desktop-wide layout. */
.stage {
  position: relative;
  min-height: 100dvh;
  background:
    radial-gradient(110% 42% at 50% -4%, rgba(126, 74, 42, .42), rgba(126, 74, 42, 0) 62%),
    radial-gradient(90% 34% at 50% 8%, rgba(94, 51, 29, .38), rgba(94, 51, 29, 0) 70%),
    linear-gradient(180deg, #0d0a07 0%, #060504 42%, #040303 100%);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
  background-size: 84px 84px;
}

.shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------- Brand header (shared) ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(64px, 12vh, 118px);
}

.logo {
  flex: none;
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5));
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .1px;
  color: var(--title);
}

/* Login-only top-right "A" mark, restored from screenshot B.
   It is the language switch button (Español / English, default Español). */
.a-badge {
  position: absolute;
  top: 26px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, .14), rgba(0, 0, 0, .55) 72%);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.a-badge span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #e9c9a4;
  color: #1c140d;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 4px 3px 0 rgba(233, 201, 164, .25);
}
.lang-menu {
  position: absolute;
  top: 82px;
  right: 20px;
  z-index: 30;
  background: #241a10;
  border: 1px solid #3a2a1a;
  border-radius: 12px;
  padding: 6px;
  min-width: 150px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.lang-menu[hidden] {
  display: none;
}
.lang-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #f0e8d5;
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.lang-item:hover {
  background: #3a2a1a;
}
.lang-item.active {
  color: #f0b90b;
  font-weight: 700;
}

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

.auth-form {
  margin-top: 46px;
  display: flex;
  flex-direction: column;
}

.field-group { margin-bottom: 22px; }
.field-group:last-of-type { margin-bottom: 0; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 15px;
  background: var(--pill);
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.field:focus-within {
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .9),
    0 0 0 2px rgba(233, 201, 164, .85);
  outline: none;
}

.field svg {
  flex: none;
  width: 26px;
  height: 26px;
  stroke: var(--icon);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pill-text);
  font-size: 17px;
  font-family: inherit;
}

.field input::placeholder {
  color: var(--placeholder);
  opacity: 1;
  white-space: nowrap;
}

/* Remember-password inside the register password pill, exactly as in
   screenshot A: the checkbox sits inside the same white pill, to the
   right of the password text, and never overlaps the input. */
.remember {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #14100b;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.box {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid #6d4a30;
  border-radius: 3px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.box:checked { background: #5e331d; border-color: #5e331d; }
.box:checked::after {
  content: "✓";
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.box:focus-visible { outline: 2px solid #e9c9a4; outline-offset: 2px; }

/* Login agreement row (screenshot B): dark background, light text. */
.agreement {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.agreement .box {
  margin-top: 1px;
  background: transparent;
  border-color: #9a9284;
}
.agreement .box:checked { background: #5e331d; border-color: #5e331d; }

.error {
  display: none;
  margin: 8px 0 0 4px;
  color: var(--error);
  font-size: 13px;
  line-height: 1.4;
}
.field-group.invalid .error { display: block; }
.field-group.invalid .field { box-shadow: 0 3px 10px rgba(0, 0, 0, .45), 0 0 0 2px #e0654f; }

/* ---------- Primary button (shared) ---------- */

.btn-primary {
  width: 100%;
  height: 58px;
  margin-top: 26px;
  border: 0;
  border-radius: var(--radius-btn);
  background: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-mid) 55%, var(--btn-bottom) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 rgba(0, 0, 0, .25),
    0 5px 16px rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 20px;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); filter: brightness(.96); }
.btn-primary:focus-visible { outline: 2px solid #e9c9a4; outline-offset: 3px; }

/* ---------- Below-button links ---------- */

.forgot {
  align-self: flex-start;
  margin-top: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: #f0ebe2;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}
.forgot:hover { opacity: .85; }

.open-account {
  margin-top: 26px;
  text-align: center;
  color: #e8e2d6;
  font-size: 17px;
  text-decoration: none;
}
.open-account:hover { opacity: .85; }

/* Register footer: pushed to the bottom, as in screenshot A. */
.spacer { flex: 1 1 auto; }

.footer-link {
  padding-top: 48px;
  text-align: center;
  color: #ddd6c9;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
}
.footer-link:hover { opacity: .85; }
.footer-link strong { font-weight: 400; color: #f3ede1; }

/* ---------- Demo modal (shared) ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .62);
}
.modal[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px 24px;
  background: #1a140f;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  text-align: center;
}
.modal-card h2 { margin: 0 0 10px; font-size: 20px; }
.modal-card p { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.modal-card .btn-primary { margin-top: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Narrow phones: keep the remember label inside the pill without
   squeezing the password input to zero. */
@media (max-width: 360px) {
  .shell { padding-left: 18px; padding-right: 18px; }
  .logo { width: 44px; height: 44px; }
  .brand h1 { font-size: 22px; }
  .remember { font-size: 12px; }
  .field input { font-size: 17px; }
}
