:root,
html {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  width: 100%;
  min-height: 100%;
  overflow-y: scroll;
  scroll-behavior: smooth;
  --mtgold: #c39953;
  --mtalt: #b22222;
  --mtblack: #000000;
  --mtwhite: #ffffff;
  --mtsilver: #505050;
  --accent: var(--mtgold);
  --accent-alt: var(--mtalt);
  --accent-soft: rgba(195, 153, 83, 0.16);
  --surface: var(--mtwhite);
  --surface-muted: rgba(195, 153, 83, 0.08);
  --border-subtle: rgba(80, 80, 80, 0.22);
  --text-primary: var(--mtblack);
  --text-secondary: rgba(80, 80, 80, 0.8);
  --text-muted: rgba(80, 80, 80, 0.6);
  --shadow-soft: rgba(0, 0, 0, 0.12);
  --shadow-medium: rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: linear-gradient(140deg, var(--surface-muted) 0%, var(--surface) 65%, rgba(0, 0, 0, 0.02) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
}

.site-header {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  gap: 1.25rem;
  padding: 1.25rem clamp(1.5rem, 7vw, 4rem);
  background: var(--mtblack);
  border-top: 6px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--mtwhite);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-header__logo {
  display: block;
  height: clamp(54px, 8vw, 72px);
  width: auto;
}

.site-header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__nav a {
  color: var(--mtwhite);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-header__nav a:hover,
.site-header__nav a:focus-visible {
  color: var(--accent);
}

main {
  width: min(420px, 92vw);
  padding: 3rem 2.5rem;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 24px 48px var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin: 2.75rem auto 3rem;
}

@media (max-width: 640px) {
  .site-header {
    padding: 1rem 1.5rem;
  }

  main {
    padding: 2.25rem 1.75rem;
    margin: 2rem auto 3rem;
  }
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--text-primary);
}

p {
  margin: 0;
  color: var(--text-secondary);
}

form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Password reveal toggle */
.password-field {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
}

.password-field input {
  padding-right: 3rem;
  width: 100%;
  box-sizing: border-box;
}

.password-field .reveal-toggle {
  position: absolute;
  right: 0.75rem;
  top: 0;
  bottom: 0;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.password-field .reveal-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.password-field.has-value .reveal-toggle,
.password-field:focus-within .reveal-toggle {
  opacity: 1;
  pointer-events: auto;
}

button[type="submit"] {
  border: none;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent);
  color: var(--mtwhite);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px var(--shadow-medium);
}

.error {
  color: var(--accent-alt);
  font-size: 0.92rem;
  min-height: 1.1rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.visible {
  display: flex;
}

.loading-overlay__box {
  background: rgba(0, 0, 0, 0.85);
  padding: 2rem 2.5rem;
  border-radius: 1.5rem;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 260px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.loading-overlay__spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--accent);
  animation: loading-spin 0.9s linear infinite;
  margin: 0 auto;
}

.loading-overlay__box p {
  margin: 0;
  font-size: 1rem;
  color: #fff;
}

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