:root {
  --bg: #f6f1ea;
  --surface: #fffdf9;
  --surface-alt: #f0e7dc;
  --text: #1e1a17;
  --muted: #6d6257;
  --accent: #6f4e37;
  --accent-soft: #e9d8c8;
  --border: rgba(30, 26, 23, 0.08);
  --shadow: 0 18px 50px rgba(37, 29, 22, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;
  --danger-border: rgba(153, 27, 27, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, #f8f2ea 0%, #efe5d8 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  position: relative;
  overflow: hidden;
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.75rem;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}

.auth-brand {
  margin-bottom: 1.75rem;
}

.auth-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 5vw, 2rem);
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--text);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.auth-field {
  display: grid;
  gap: 0.4rem;
}

.auth-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(111, 78, 55, 0.35);
  box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.12);
}

.auth-row-between {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.25rem;
}

.auth-link {
  font-size: 0.8125rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link.is-muted {
  color: var(--muted);
}

.auth-button {
  margin-top: 0.25rem;
  width: 100%;
  min-height: 44px;
  padding: 0.85rem 1.15rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fffdf9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(111, 78, 55, 0.18);
  transition: filter 0.15s ease, transform 0.1s ease;
}

.auth-button:hover:not(:disabled) {
  filter: brightness(1.04);
}

.auth-button:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-button-google {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.72;
}

.auth-button-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.auth-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.25rem;
}

.auth-error {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  font-size: 0.875rem;
}

.auth-error.is-visible {
  display: block;
}

@media (max-width: 400px) {
  .auth-card {
    padding: 1.5rem 1.25rem 1.35rem;
  }
}