* {
  box-sizing: border-box;
}

:root {
  --bg-0: #f7faff;
  --bg-1: #ffffff;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --line: #dbeafe;
  --brand-700: #1d4ed8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --accent-500: #f59e0b;
  --accent-400: #fbbf24;
  --success-600: #059669;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.14);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  font-family: "Poppins", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(1200px 700px at -10% -10%, rgba(59, 130, 246, 0.15), transparent 62%),
    radial-gradient(900px 500px at 110% 0%, rgba(251, 191, 36, 0.18), transparent 60%),
    linear-gradient(155deg, var(--bg-0) 0%, var(--bg-1) 100%);
}

body.landing-page {
  background-image: url("/images/login-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-bg-rotator {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login-bg-rotator .bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.08) translateX(0);
  filter: blur(1.5px);
  transition: opacity 850ms ease, transform 850ms ease, filter 850ms ease;
}

.login-bg-rotator .bg-slide.active {
  opacity: 1;
  transform: scale(1) translateX(0);
  filter: blur(0);
}

.login-bg-rotator .bg-slide.enter-right {
  transform: scale(1.08) translateX(4%);
}

.login-bg-rotator .bg-slide.enter-left {
  transform: scale(1.08) translateX(-4%);
}

.login-bg-rotator .bg-slide.exit-left {
  opacity: 0;
  transform: scale(1.03) translateX(-3%);
  filter: blur(1.2px);
}

.login-bg-rotator .bg-slide.exit-right {
  opacity: 0;
  transform: scale(1.03) translateX(3%);
  filter: blur(1.2px);
}

.auth-container {
  width: min(100%, 420px);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  margin: auto;
}

.landing-page .auth-layout {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.2rem;
  align-items: stretch;
}

.landing-page .brand-panel {
  border: 1px solid #d1e4ff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.8rem;
  background:
    radial-gradient(380px 220px at 100% 0%, rgba(251, 191, 36, 0.2), transparent 70%),
    linear-gradient(155deg, #1d4ed8 0%, #2563eb 58%, #3b82f6 100%);
  color: #eff6ff;
  box-shadow: var(--shadow-lg);
}

.landing-page .brand-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.landing-page .brand-title {
  margin: 0 0 0.75rem;
  text-align: left;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
}

.landing-page .brand-copy {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.55;
  color: #dbeafe;
}

.landing-page .brand-points {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
  color: #e2e8f0;
  font-size: 0.92rem;
}

.landing-page .auth-layout .auth-container {
  width: min(100%, 420px);
  max-width: 420px;
  justify-self: center;
}

.auth-section {
  display: grid;
  gap: 0.7rem;
}

h1 {
  margin: 0.1rem 0 0.55rem;
  font-size: 1.45rem;
  text-align: center;
  color: #0b2a66;
  letter-spacing: 0.01em;
}

form {
  display: grid;
  gap: 0.65rem;
}

#loginForm {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

#registerForm {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

#loginForm input,
#loginForm button {
  width: 100%;
}

input {
  width: 100%;
  padding: 0.72rem 0.8rem;
  margin: 0;
  border: 1px solid #cfe0fb;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink-900);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

input[type="date"] {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  color: #2c3e50;
}

select {
  width: 100%;
  padding: 0.72rem 0.8rem;
  margin: 0;
  border: 1px solid #cfe0fb;
  border-radius: var(--radius-md);
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink-900);
}

.birthday-row {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 1fr;
  gap: 0.5rem;
}

.birthday-row select {
  margin: 0.1rem 0 0;
}

#captcha label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

button {
  width: 100%;
  padding: 0.72rem 0.9rem;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-600));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, filter 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-otp {
  background: linear-gradient(90deg, var(--accent-500), var(--accent-400));
  color: #1f2937;
}

.btn-otp:hover {
  filter: brightness(1.05);
}

.btn-verify {
  background: linear-gradient(90deg, #10b981, var(--success-600));
}

.btn-verify:hover {
  filter: brightness(1.04);
}

#message {
  margin-top: 0.75rem;
  text-align: center;
  min-height: 1.2rem;
  color: var(--ink-700);
  font-size: 0.92rem;
}

.auth-message {
  margin: 0.75rem auto 0;
  max-width: 360px;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.auth-message.success {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.auth-message.error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.hidden {
  display: none;
}

#forgotPasswordLink {
  font-size: 0.9rem;
}

.auth-section p {
  margin: 0.2rem 0 0;
  color: var(--ink-700);
  font-size: 0.95rem;
  max-width: 360px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.auth-section a {
  color: var(--brand-700);
  font-weight: 600;
  text-decoration: none;
}

.auth-section a:hover {
  text-decoration: underline;
}

.age-preview {
  margin: 0.15rem 0 0.2rem;
  font-size: 0.9rem;
  color: var(--ink-500);
  font-weight: 500;
}

@media (max-width: 560px) {
  body {
    padding: 1rem 0.8rem;
  }

  .auth-container {
    width: 100%;
    border-radius: 14px;
    padding: 1.15rem 0.95rem 1rem;
  }

  h1 {
    font-size: 1.28rem;
  }

  .birthday-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .landing-page .auth-layout {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .landing-page .brand-panel {
    padding: 1.2rem 1rem;
  }

  .landing-page .brand-title {
    font-size: 1.5rem;
  }
}

@media (max-height: 720px) {
  body {
    place-items: start center;
  }
}
