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

:root {
  --ink: #121212;
  --paper: #ffffff;
  --mist: #f7f5f3;
  --muted: #6b6b6b;
  --mint: #be1622;
  --mint-deep: #9a1119;
  --panel: #ffffff;
  --line: rgba(18, 18, 18, 0.1);
  --display: 'Libre Baskerville', Georgia, serif;
  --body: 'DM Sans', system-ui, sans-serif;
}

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

body {
  font-family: var(--body);
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #ffffff;
}

.bg-grid {
  display: none;
}

.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 18px 48px rgba(18, 18, 18, 0.08);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.auth-brand img {
  height: 40px;
  width: auto;
  display: block;
}

.auth-title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 1.15rem;
}

.auth-error {
  background: rgba(190, 22, 34, 0.08);
  border: 1px solid rgba(190, 22, 34, 0.28);
  color: #9a1119;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.autofill-trap {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

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

.field .optional {
  font-weight: 400;
  opacity: 0.75;
}

.field input {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--mist);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  width: 100%;
}

.field input::placeholder {
  color: rgba(107, 107, 107, 0.75);
}

.field input:focus {
  outline: 2px solid rgba(190, 22, 34, 0.35);
  outline-offset: 1px;
  border-color: rgba(190, 22, 34, 0.55);
  background: #fff;
}

/* Detect browser autofill injection (login.js clears until the user types). */
@keyframes authAutofillStart {
  from { opacity: 1; }
  to { opacity: 1; }
}

#credBlock input:-webkit-autofill,
#credBlock input:-moz-autofill {
  animation-name: authAutofillStart;
  animation-duration: 0.01s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #fff;
  margin-top: 0.35rem;
}

.btn-google {
  background: var(--mist);
  color: var(--ink);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.btn-link {
  background: transparent;
  color: var(--muted);
  margin-top: 0.75rem;
  font-weight: 500;
  font-size: 0.92rem;
}

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

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.25rem 0 1rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-foot {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-foot a {
  color: var(--mint);
  text-decoration: none;
}
