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

:root {
  --bg: #000000;
  --card-border: #5f6368;
  --text: #e3e3e3;
  --muted: #a8abb0;
  --blue: #8ab4f8;
  --blue-hover: #aecbfa;
  --error: #f28b82;
  --script: "Lucida Calligraphy", "Playball", cursive;
  --sans: "Inter", "Segoe UI", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrapper {
  width: 100%;
  max-width: 560px;
}

/* "Already have an account? Sign in" */
.switch-line {
  margin: -28px 0 28px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--muted);
}

.inline-link {
  color: var(--blue);
  font-weight: 500;
}

.inline-link:hover {
  color: var(--blue-hover);
  text-decoration: underline;
}

form[hidden],
.panel[hidden],
.confirm-panel[hidden] {
  display: none !important;
}

/* Continue with Google */
.oauth {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 26px;
}

.oauth[hidden] {
  display: none;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  border: 1px solid var(--card-border);
  border-radius: 26px;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.google-btn:hover {
  background: rgba(138, 180, 248, 0.08);
  border-color: var(--blue);
}

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  border-top: 1px solid #3c4043;
}

/* 6-digit email code */
.code-input {
  font-size: 1.6rem !important;
  letter-spacing: 10px;
  font-family: Consolas, "Courier New", monospace !important;
}

.code-actions {
  display: flex;
  gap: 22px;
  margin-top: 10px;
}

.small-link {
  font-size: 0.92rem !important;
}

.small-link:disabled {
  color: var(--muted);
  cursor: default;
}

/* Sign in page panels */
.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.35s ease;
}

button.link {
  font-family: var(--sans);
  padding: 0;
}

.link.forgot {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 0.95rem;
}

/* "Check your email" after sign-up */
.confirm-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.35s ease;
}

.confirm-panel strong {
  color: var(--text);
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 10px auto 22px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  color: var(--blue);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

a.btn-next {
  display: inline-block;
}

.btn-next:disabled {
  opacity: 0.7;
  cursor: wait;
}

.notice {
  color: var(--blue);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 4px;
}

/* ---------- Card ---------- */
.card {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 48px 50px 40px;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #1f1f1f;
}

.progress-bar {
  height: 100%;
  width: 25%;
  background: var(--blue);
  transition: width 0.4s ease;
}

.brand {
  display: block;
  text-align: center;
  font-family: var(--script);
  font-style: italic;
  font-size: 1.9rem;
  color: #fff;
  margin-bottom: 18px;
}

form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---------- Steps ---------- */
.step {
  display: none;
  flex-direction: column;
  animation: slideIn 0.35s ease;
}

.step.active {
  display: flex;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.title {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 12px;
}

.subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 40px;
}

/* ---------- Floating label inputs ---------- */
.field {
  position: relative;
  margin-bottom: 22px;
}

.field input,
.field select {
  width: 100%;
  height: 64px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: #fff;
  font-size: 1.05rem;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus,
.field select:focus {
  border: 2px solid var(--blue);
  padding: 0 15px;
}

/* Year list (sign-up): the label floats up once a year is chosen */
.field select {
  cursor: pointer;
}

.field select option {
  background: #202124;
  color: #fff;
}

.field select:focus + label,
.field select:valid + label {
  top: 0;
  font-size: 0.8rem;
}

.field select:focus + label {
  color: var(--blue);
}

.field select.invalid {
  border-color: var(--error);
}

.field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  background: var(--bg);
  color: var(--muted);
  font-size: 1.05rem;
  pointer-events: none;
  transition: all 0.15s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.8rem;
}

/* Chrome's saved emails and passwords: the label floats up (Chrome hides
   autofilled text from the rule above until the page is clicked), and the
   box keeps WRITY's dark fill and white text instead of light blue. Kept
   apart so browsers that don't know :-webkit-autofill still float labels. */
.field input:-webkit-autofill + label {
  top: 0;
  font-size: 0.8rem;
}

.field input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px var(--bg) inset;
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
}

.field input:focus + label {
  color: var(--blue);
}

.field input.invalid {
  border-color: var(--error);
}

.field input.invalid + label {
  color: var(--error);
}

/* hide number arrows */
.field input[type="number"]::-webkit-outer-spin-button,
.field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field input[type="number"] {
  -moz-appearance: textfield;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: -8px;
}

/* Sign-up, email step: what happens to their details */
.hint.privacy-note {
  margin: 4px 0 16px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.error {
  color: var(--error);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-top: 4px;
}

/* Bot check (captcha.js); empty when it's off */
.captcha:not(:empty) {
  margin-top: 12px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

/* "I agree to the Terms…": long text, so the box sits at the top */
.terms-check {
  align-items: flex-start;
  margin-top: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}

.terms-check input {
  flex-shrink: 0;
  margin-top: 2px;
}

.terms-check.invalid {
  color: var(--error);
}

/* ---------- Actions ---------- */
.actions {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link {
  color: var(--blue);
  font-weight: 500;
  font-size: 1.05rem;
  cursor: pointer;
  background: none;
  border: none;
}

.link:hover {
  color: var(--blue-hover);
}

.btn-next {
  background: var(--blue);
  color: #062e6f;
  border: none;
  border-radius: 6px;
  padding: 14px 30px;
  font-size: 1.05rem;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-next:hover {
  background: var(--blue-hover);
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 0;
  font-size: 0.95rem;
}

.footer select {
  background: transparent;
  color: var(--text);
  border: none;
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
}

.footer select option {
  background: #202124;
}

.footer-links {
  display: flex;
  gap: 36px;
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .card {
    padding: 40px 22px 28px;
    min-height: 540px;
  }

  .title {
    font-size: 1.5rem;
  }

  .footer {
    flex-direction: column;
    gap: 14px;
  }

  .footer-links {
    gap: 24px;
  }
}
