:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #c3d9ff 0%, #eff4ff 45%, #ffffff 100%);
  padding: 2rem;
  color: #0f172a;
}

main {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.18);
  text-align: center;
  position: relative;
}

.language-switcher {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.language-switcher button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.06);
  color: inherit;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.language-switcher button:hover,
.language-switcher button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 18px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.6);
  outline: none;
}

.language-switcher button[aria-pressed="true"] {
  background: linear-gradient(120deg, #0f172a, #2563eb, #38bdf8);
  color: #fff;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.35);
}

h1 {
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

p {
  margin: 0 0 2rem;
  font-size: 1rem;
  line-height: 1.6;
  color: inherit;
}

button,
.google-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(120deg, #0f172a, #2563eb, #38bdf8);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.35);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button:hover,
.google-link:hover,
button:focus-visible,
.google-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(37, 99, 235, 0.45);
  filter: brightness(1.03);
  outline: none;
}

button:active,
.google-link:active {
  transform: translateY(1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.25);
}

.secondary-button {
  margin-top: 1rem;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  border: 1px solid rgba(15, 23, 42, 0.2);
  box-shadow: none;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  filter: none;
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.15);
}

.link-button {
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.session-reset {
  margin-bottom: 1.5rem;
}

.manual-login-form {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.manual-login-form input[type='email'] {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  padding: 0.85rem 1.2rem;
  font-size: 1rem;
}

.manual-login-form input[type='email']:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.section-title {
  font-size: 1.25rem;
  margin: 2rem 0 0.5rem;
}

.section-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.google-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-block;
}

.alert {
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

[hidden] {
  display: none !important;
}

footer {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: inherit;
  opacity: 0.7;
}

.language-switcher button:focus-visible,
button:focus-visible,
.link-button:focus-visible,
.manual-login-form input[type='email']:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

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

@media (prefers-color-scheme: dark) {
  body:not(.light) {
    background: radial-gradient(circle at top, #0b1120 0%, #0f172a 60%, #111827 100%);
    color: #f8fafc;
  }

  body:not(.light) main {
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.4);
  }

  .language-switcher button {
    background: rgba(148, 163, 184, 0.15);
  }

  .secondary-button {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.45);
    color: inherit;
  }

  .manual-login-form input[type='email'] {
    background: rgba(15, 23, 42, 0.25);
    border-color: rgba(148, 163, 184, 0.35);
    color: inherit;
  }

  .manual-login-form input[type='email']::placeholder {
    color: rgba(226, 232, 240, 0.6);
  }
}
