:root {
  --wine: #8b0012;
  --wine-dark: #65000d;
  --cream: #fffaf4;
  --paper: #ffffff;
  --text: #33261f;
  --muted: #7b6658;
  --border: #decfbc;
  --border-strong: #ccb69f;
  --danger: #a32435;
  --success: #2f7452;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 0, 18, 0.055), transparent 38%),
    #ffffff;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.auth-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 14px 18px;
}

.auth-card {
  width: min(100%, 450px);
  padding: 20px 28px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 24px 60px rgba(101, 0, 13, 0.15);
}

.auth-brand {
  display: grid;
  width: 40px;
  height: 40px;
  margin-bottom: 9px;
  place-items: center;
  border-radius: 12px;
  color: #fff7e9;
  background: var(--wine);
  box-shadow: 0 10px 24px rgba(101, 0, 13, 0.22);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 800;
}

.auth-kicker {
  margin: 0 0 6px;
  color: #ad8b75;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

.auth-card h1 {
  margin: 0;
  color: var(--wine-dark);
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

.auth-intro {
  margin: 5px 0 13px;
  color: var(--muted);
  font-size: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--cream);
}

.auth-tab {
  min-height: 35px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.active {
  color: #fff;
  background: var(--wine);
  box-shadow: 0 7px 16px rgba(101, 0, 13, 0.18);
}

.auth-form {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.auth-form[hidden],
.auth-form [hidden] {
  display: none;
}

.auth-form label {
  display: grid;
  gap: 4px;
  color: #4a3830;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  outline: none;
  color: var(--text);
  background: #fff;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.auth-form input:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 3px rgba(139, 0, 18, 0.1);
}

.auth-form small {
  color: #9a8477;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.email-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 7px;
}

.login-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.login-method {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.login-method.active {
  border-color: var(--wine);
  color: var(--wine-dark);
  background: var(--cream);
}

.primary-button,
.secondary-button {
  border-radius: 9px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  min-height: 42px;
  border: 0;
  color: #fff;
  background: var(--wine);
  box-shadow: 0 10px 20px rgba(101, 0, 13, 0.2);
}

.secondary-button {
  border: 1px solid var(--border-strong);
  color: var(--wine-dark);
  background: #fff;
  font-size: 13px;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.form-message {
  min-height: 16px;
  margin: -2px 0 -3px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.form-message.success {
  color: var(--success);
}

.auth-footnote {
  margin: 12px 0 0;
  padding-top: 9px;
  border-top: 1px solid #eee2d2;
  color: #9b887d;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 520px) {
  .auth-page {
    padding: 0;
    background: #fff;
  }

  .auth-card {
    min-height: 100dvh;
    padding: 18px 18px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .email-code-row {
    grid-template-columns: minmax(0, 1fr) 104px;
  }

  .secondary-button {
    min-height: 40px;
  }
}

@media (max-height: 620px) {
  .auth-brand,
  .auth-kicker {
    display: none;
  }

  .auth-page {
    padding-block: 0;
  }

  .auth-card {
    padding-block: 14px;
  }
}
