@font-face {
  font-family: "Montserrat";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/montserrat-500.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("/assets/fonts/montserrat-700.woff2") format("woff2");
}

:root {
  --navy: #071A38;
  --card: #0F2648;
  --input: #122C52;
  --teal: #2E95A8;
  --teal-strong: #1F6E8C;
  --sage: #84A7A1;
  --white: #FFFFFF;
  --error: #FF8A80;
  --success: #6FCF97;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(40px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.brand {
  width: 168px;
  aspect-ratio: 2415 / 2277;
  max-width: 50%;
  margin-bottom: 32px;
  background-color: var(--white);
  -webkit-mask: url("/assets/barlay-cap-mono.svg") center / contain no-repeat;
  mask: url("/assets/barlay-cap-mono.svg") center / contain no-repeat;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

h1 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
  outline: none;
}

p { margin: 0 0 16px; color: var(--sage); }
p:last-child { margin-bottom: 0; }
p strong { color: var(--white); font-weight: 700; overflow-wrap: anywhere; }
.muted { margin-bottom: 24px; }

form { text-align: left; }

.field { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--sage);
}

.password { position: relative; }

input[type="password"], input[type="text"] {
  width: 100%;
  height: 52px;
  padding: 0 72px 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--input);
  color: var(--white);
  font: inherit;
}

input:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

input[aria-invalid="true"] { border-color: var(--error); }

.toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 44px;
  min-width: 60px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.error {
  min-height: 0;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--error);
}
.error:empty { display: none; }

button.primary, button.secondary {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.primary {
  border: 0;
  background: var(--teal-strong);
  color: var(--white);
}
button.primary:hover { background: var(--teal); }
button.primary[disabled] { opacity: 0.6; cursor: progress; }

button.secondary {
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--white);
  margin-top: 20px;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 4px auto 20px;
  border: 3px solid rgba(132, 167, 161, 0.3);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid var(--success);
  position: relative;
}
.mark::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 10px;
  width: 12px;
  height: 24px;
  border: solid var(--success);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.mark[data-tone="error"] { border-color: var(--error); }
.mark[data-tone="error"]::after {
  content: "!";
  position: static;
  display: block;
  width: auto;
  height: auto;
  border: 0;
  transform: none;
  color: var(--error);
  font-size: 30px;
  font-weight: 700;
  line-height: 50px;
}

.footnote {
  margin-top: 24px;
  font-size: 12px;
  color: var(--sage);
  opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}
