/**
 * Mammeto Login — Kids & Family Brand
 * Warm, playful, friendly. Learn through play.
 */

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

:root {
  /* Mammeto palette: warm, kid-friendly */
  --mammeto-bg: #fff8f2;
  --mammeto-bg-warm: #fff5eb;
  --mammeto-card: #ffffff;
  --mammeto-brand-bg: linear-gradient(165deg, #fffbf7 0%, #fff0e6 35%, #ffe8dc 100%);
  --mammeto-coral: #e8957a;
  --mammeto-coral-light: #f4a89a;
  --mammeto-coral-bright: #ffb5a0;
  --mammeto-coral-pale: #ffddd4;
  --mammeto-teal: #7bc4b5;
  --mammeto-teal-light: #9dd9c8;
  --mammeto-cream: #fffaf5;
  --mammeto-peach: #ffcba4;
  --mammeto-text: #3d3229;
  --mammeto-text-soft: #6b5b4f;
  --mammeto-muted: #9a8a7d;
  --mammeto-border: rgba(232, 149, 122, 0.35);
  --mammeto-glow: rgba(232, 149, 122, 0.22);
  --mammeto-shadow: rgba(232, 149, 122, 0.1);
  --mammeto-error: #d87878;
}

@keyframes mammeto-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-12px) scale(1.02); }
}

@keyframes mammeto-float-slow {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(5px, -8px) rotate(2deg); }
  66% { transform: translate(-4px, 5px) rotate(-1deg); }
}

@keyframes mammeto-bounce-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mammeto-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mammeto-bubble {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.1); }
}

@keyframes mammeto-shine-sweep {
  0% { left: -100%; }
  100% { left: 100%; }
}

@keyframes mammeto-soft-pulse {
  0%, 100% { box-shadow: 0 20px 60px var(--mammeto-shadow), 0 0 0 1px rgba(232, 149, 122, 0.12); }
  50% { box-shadow: 0 24px 70px rgba(232, 149, 122, 0.14), 0 0 0 1px rgba(232, 149, 122, 0.18); }
}

@keyframes mammeto-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--mammeto-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 10% 10%, rgba(255, 235, 220, 0.85) 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 90% 85%, rgba(255, 221, 212, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(123, 196, 181, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, var(--mammeto-bg) 0%, var(--mammeto-bg-warm) 100%);
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: 12%;
  right: 8%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(232, 149, 122, 0.18) 0%, rgba(244, 168, 154, 0.06) 45%, transparent 70%);
  border-radius: 50%;
  animation: mammeto-float 16s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

/* Playful bubbles in background */
.mammeto-bubbles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.mammeto-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--mammeto-coral-pale), var(--mammeto-teal-light));
  opacity: 0.6;
  animation: mammeto-bubble 4s ease-in-out infinite;
}

.mammeto-bubble:nth-child(1) { width: 20px; height: 20px; top: 15%; left: 10%; animation-delay: 0s; background: var(--mammeto-coral-pale); }
.mammeto-bubble:nth-child(2) { width: 14px; height: 14px; top: 28%; right: 15%; animation-delay: 0.8s; background: var(--mammeto-teal-light); }
.mammeto-bubble:nth-child(3) { width: 24px; height: 24px; top: 55%; left: 6%; animation-delay: 1.6s; background: var(--mammeto-peach); }
.mammeto-bubble:nth-child(4) { width: 12px; height: 12px; top: 72%; right: 10%; animation-delay: 2.4s; background: var(--mammeto-coral-pale); }
.mammeto-bubble:nth-child(5) { width: 18px; height: 18px; top: 38%; left: 22%; animation-delay: 0.4s; background: var(--mammeto-teal-light); }
.mammeto-bubble:nth-child(6) { width: 16px; height: 16px; top: 78%; left: 28%; animation-delay: 1.2s; background: var(--mammeto-peach); }
.mammeto-bubble:nth-child(7) { width: 22px; height: 22px; top: 10%; left: 48%; animation-delay: 2s; background: var(--mammeto-coral-pale); }
.mammeto-bubble:nth-child(8) { width: 14px; height: 14px; top: 48%; right: 22%; animation-delay: 0.6s; background: var(--mammeto-teal-light); }
.mammeto-bubble:nth-child(9) { width: 20px; height: 20px; top: 85%; left: 52%; animation-delay: 1.8s; background: var(--mammeto-peach); }
.mammeto-bubble:nth-child(10) { width: 16px; height: 16px; top: 20%; right: 38%; animation-delay: 2.2s; background: var(--mammeto-coral-pale); }

/* Soft dot pattern */
.mammeto-dots-pattern {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(232, 149, 122, 0.08) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.9;
  z-index: 0;
  pointer-events: none;
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: var(--mammeto-card);
  border-radius: 32px;
  overflow: hidden;
  min-height: 620px;
  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(232, 149, 122, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  animation: mammeto-soft-pulse 5s ease-in-out infinite;
}

/* —— Brand (left) —— */
.brand-section {
  padding: 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--mammeto-brand-bg);
}

.brand-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 100% 80% at 20% 30%, rgba(232, 149, 122, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 80% 100% at 80% 70%, rgba(157, 217, 200, 0.25) 0%, transparent 50%);
  z-index: 0;
}

.brand-section::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35) 0%, transparent 8%);
  animation: mammeto-float-slow 22s linear infinite;
  z-index: 0;
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mammeto-logo {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  margin-bottom: 28px;
  filter: drop-shadow(0 4px 12px rgba(232, 149, 122, 0.2));
  animation: mammeto-fade-up 0.6s ease-out;
}

.mammeto-logo-placeholder {
  width: 90px;
  height: 90px;
  border: 3px solid var(--mammeto-coral);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--mammeto-coral);
  margin-bottom: 24px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 6px 20px var(--mammeto-shadow);
  animation: mammeto-bounce-in 0.7s ease-out;
}

.brand-title {
  font-family: 'Nunito', sans-serif;
  font-size: 52px;
  font-weight: 800;
  color: var(--mammeto-text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 12px;
  animation: mammeto-bounce-in 0.8s ease-out 0.1s both;
}

.brand-title .highlight {
  color: var(--mammeto-coral);
  position: relative;
  display: inline-block;
  text-shadow: 0 0 40px rgba(232, 149, 122, 0.25);
}

.brand-tagline {
  font-size: 15px;
  color: var(--mammeto-muted);
  font-weight: 600;
  max-width: 260px;
  line-height: 1.45;
  animation: mammeto-fade-up 0.8s ease-out 0.2s both;
}

/* Decorative corner — playful */
.brand-section .corner-ornament {
  position: absolute;
  bottom: 28px;
  right: 28px;
  width: 70px;
  height: 70px;
  border-right: 3px solid var(--mammeto-border);
  border-bottom: 3px solid var(--mammeto-border);
  border-radius: 0 0 20px 0;
  opacity: 0.6;
}

/* —— Form (right) —— */
.form-section {
  padding: 56px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, #fffbf7 100%);
  border-left: 1px solid rgba(232, 149, 122, 0.15);
  position: relative;
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse 80% 80% at 100% 20%, rgba(255, 248, 242, 0.9) 0%, transparent 50%);
  pointer-events: none;
}

.form-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 36px;
}

.form-title {
  font-family: 'Nunito', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--mammeto-text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 15px;
  color: var(--mammeto-muted);
  font-weight: 600;
}

.input-group {
  margin-bottom: 24px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--mammeto-text-soft);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
  border-radius: 20px;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}

.input-wrapper:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--mammeto-shadow);
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 248, 242, 0.95);
  border: 2px solid rgba(232, 149, 122, 0.2);
  border-radius: 20px;
  color: var(--mammeto-text);
  font-size: 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--mammeto-muted);
  font-weight: 500;
}

.form-input:focus {
  border-color: var(--mammeto-coral);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--mammeto-glow);
}

.form-input.is-invalid {
  border-color: var(--mammeto-error);
  box-shadow: 0 0 0 2px rgba(216, 120, 120, 0.2);
}

.invalid-feedback {
  color: var(--mammeto-error);
  font-size: 13px;
  margin-top: 8px;
  font-weight: 600;
}

.remember-me-group {
  margin-bottom: 26px;
}

.remember-me-group label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--mammeto-text-soft);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}

.remember-me-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--mammeto-coral);
  cursor: pointer;
  border-radius: 6px;
}

.submit-btn {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--mammeto-coral) 0%, var(--mammeto-coral-light) 50%, var(--mammeto-coral-bright) 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 28px rgba(232, 149, 122, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: mammeto-shine-sweep 2.5s ease-in-out infinite;
}

.submit-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 36px rgba(232, 149, 122, 0.45);
  filter: brightness(1.06);
}

.submit-btn:hover::before {
  animation: mammeto-shine-sweep 0.9s ease-in-out;
}

.submit-btn:active {
  transform: translateY(-1px);
}

.form-footer {
  margin-top: 24px;
  text-align: center;
}

.form-footer a {
  color: var(--mammeto-coral);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.form-footer a:hover {
  color: var(--mammeto-coral-bright);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
  .login-container {
    grid-template-columns: 1fr;
    max-width: 480px;
    min-height: auto;
    border-radius: 28px;
  }

  .brand-section {
    padding: 40px 32px;
    min-height: 220px;
  }

  .brand-title {
    font-size: 42px;
  }

  .brand-tagline {
    font-size: 14px;
  }

  .mammeto-logo {
    max-width: 160px;
  }

  .form-section {
    padding: 40px 32px;
    border-left: none;
    border-top: 1px solid rgba(232, 149, 122, 0.15);
  }

  .brand-section .corner-ornament {
    display: none;
  }
}

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

  .brand-title {
    font-size: 34px;
  }

  .mammeto-logo {
    max-width: 140px;
  }

  .form-title {
    font-size: 26px;
  }

  .brand-section,
  .form-section {
    padding: 28px 20px;
  }

  .mammeto-bubble {
    width: 12px !important;
    height: 12px !important;
    max-width: 16px;
    max-height: 16px;
  }
}
