* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =========================
   BODY — solid brand-color backdrop, single truly-centered card.
   The color itself carries the "pop"; the card stays flat/professional.
========================= */
body {
  min-height: 100vh;
  background: var(--primary);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: pageFade 0.3s ease-out;
}

/* Page Fade In */
@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   MAIN CONTAINER
========================= */
.container {
  position: relative;
  width: 100%;
  max-width: 400px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;

  opacity: 0;
  transform: translateY(14px);
  animation: cardEntrance 0.5s ease forwards;
  animation-delay: 0.1s;
}

/* Card Entrance Animation */
@keyframes cardEntrance {
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================
   CARD HEADER — solid brand blue as the base (no gradient), with a
   restrained dot-grid texture and one solid geometric accent shape
   for depth. No blur, no glow, no color-blend gradient.
========================= */
.login-card-header {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  color: #fff;
  padding: 36px 32px 26px;
}

/* Tiled dot grid — a flat, repeating texture (each dot is a hard-edged
   tiny circle, not a soft glow), the same device Stripe/Linear/Figma
   use on solid-color panels. */
.login-card-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  z-index: 0;
}

/* One solid diagonal block in the darker brand shade — a flat geometric
   shape (clip-path), not a gradient blend, tucked in the corner. */
.login-card-header::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -18%;
  width: 60%;
  height: 160%;
  background: var(--primary-hover);
  opacity: 0.45;
  clip-path: polygon(60% 0, 100% 0, 40% 100%, 0% 100%);
  z-index: 0;
}

.login-card-header > * {
  position: relative;
  z-index: 1;
}

.login-card-body {
  padding: 28px 32px 34px;
}

#logo_login {
  width: 56px;
  height: 56px;
  object-fit: cover;
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;

  opacity: 0;
  transform: scale(0.7);
  animation: logoPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.25s;
}

/* Small, tasteful entrance — a quick pop with a slight overshoot,
   not a looping/floating animation. */
@keyframes logoPop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.google-btn {
  opacity: 0;
  animation: cardEntrance 0.35s ease forwards;
  animation-delay: 0.5s;
}

.login-card-header h1 {
  position: relative;
  display: inline-block;
  font-size: 1.55rem;
  line-height: 1.1;
  margin-top: 16px;
  padding-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

/* Second small animation — a light accent line draws itself in under
   the heading once the text has settled. */
.login-card-header h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%);
  animation: underlineDraw 0.4s ease forwards;
  animation-delay: 0.6s;
}

@keyframes underlineDraw {
  to { width: 44px; }
}

.login-card-sub {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.brand-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

/* =========================
   HEADINGS
========================= */
h2 {
  margin-bottom: 20px;
  font-weight: 500;
  color: var(--text-main);
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.section-copy {
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* =========================
   INPUTS
========================= */
input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  outline: none;
  font-size: 14px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  background: var(--surface-muted);
  color: var(--text-main);
}

input:focus {
  box-shadow: 0 0 0 3px var(--primary-soft);
  border-color: var(--primary);
  background: var(--surface);
}

input::placeholder {
  color: var(--text-muted);
}

/* =========================
   BUTTON ROW
========================= */
.buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

/* =========================
   BUTTONS
========================= */
button {
  flex: 1;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s ease;
}

/* Login Button */
#login-btn {
  background: var(--primary);
  color: #fff;
}

#login-btn:hover {
  background: var(--primary-hover);
}

/* Reset Toggle Button */
#showReset {
  background: var(--surface-muted);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
}

#showReset:hover {
  background: var(--border-soft);
}

/* =========================
   RESET PASSWORD SECTION
========================= */
#resetSection {
  margin-top: 20px;
  padding: 18px 16px 6px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  display: none;
  animation: fadeIn 0.2s ease-in-out;
  border: 1px solid var(--border-soft);
}

#resetSection input {
  margin-bottom: 12px;
}

#resetSection button {
  width: 100%;
  background: var(--success);
  color: #fff;
}

#resetSection button:hover {
  filter: brightness(0.92);
}

/* Smooth Show Class (optional if toggling via JS) */
#resetSection.show {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

/* =========================
   FADE IN ANIMATION
========================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .login-card-header {
    padding: 28px 22px 22px;
  }

  .login-card-body {
    padding: 24px 22px 28px;
  }

  .login-card-header h1 {
    font-size: 1.35rem;
  }

  .buttons {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .container,
  #logo_login,
  .google-btn,
  .login-card-header h1::after,
  #resetSection {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .login-card-header h1::after {
    width: 44px !important;
  }

  button,
  input,
  .container {
    transition: none !important;
  }
}

/* Google login */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}
/* Google's brand guidelines call for a light, high-contrast button
   regardless of app theme — intentionally not tokenized to --surface. */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
}
.google-btn:hover {
  background: #f8f9fa;
}
.google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.google-error {
  word-break: break-word;
}
