@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&display=swap');

:root {
  --mcd-red: #DA291C;
  --mcd-red-deep: #B61F14;
  --mcd-red-dark: #8B1510;
  --mcd-yellow: #FFC72C;
  --mcd-yellow-soft: #FFE082;
  --mcd-cream: #FFF8E7;
  --mcd-paper: #FFFCF5;
  --mcd-ink: #27251F;
  --mcd-mute: #6B6560;
  --mcd-line: #F0E6D0;
  --ea-safe-t: env(safe-area-inset-top, 0px);
  --ea-safe-b: env(safe-area-inset-bottom, 0px);
  --ea-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body.mf-auth {
  position: fixed;
  inset: 0;
  width: 100%;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--mcd-ink);
  background: var(--mcd-cream);
  overflow: hidden;
}

body.mf-auth--register {
  background: var(--mcd-red-dark);
}

/* ---- Login layout ---- */
.mf-wrap {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mf-wrap--split {
  padding:
    calc(12px + var(--ea-safe-t))
    18px
    calc(12px + var(--ea-safe-b));
  gap: 10px;
  overflow-y: auto;
}

/* Hero photo (login) */
.mcd-hero {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.mcd-hero .ea-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.mcd-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(218, 41, 28, 0.55) 0%, rgba(218, 41, 28, 0.15) 35%, rgba(255, 248, 231, 0) 55%),
    linear-gradient(0deg, rgba(255, 248, 231, 0.98) 0%, rgba(255, 248, 231, 0.75) 18%, transparent 42%);
  pointer-events: none;
}

.mcd-hero__logo {
  position: absolute;
  top: calc(16px + var(--ea-safe-t));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
}

.mcd-hero__logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}

.mcd-hero__logo p {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
  color: var(--mcd-yellow);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.02em;
}

/* Ticket form card (login) */
.mcd-ticket {
  position: relative;
  flex-shrink: 0;
  margin: 0;
  padding: 20px 22px 24px;
  background: var(--mcd-paper);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.12);
}

.mcd-ticket__arch {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mcd-cream);
  box-shadow: 0 0 0 4px var(--mcd-paper);
}

.mcd-bites {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 0 12px;
}

.mcd-bites img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
  animation: mcd-float 3s ease-in-out infinite;
}

.mcd-bites img:nth-child(2) { animation-delay: 0.4s; }
.mcd-bites img:nth-child(3) { animation-delay: 0.8s; }

@keyframes mcd-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Register layout */
.mcd-reg-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mcd-reg-top img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.mcd-reg-top__kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mcd-yellow-soft);
}

.mcd-reg-top h1 {
  margin: 2px 0 0;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.mcd-reg-photo {
  position: relative;
  flex-shrink: 0;
  border-radius: 20px;
  overflow: hidden;
  max-height: 160px;
}

.mcd-reg-photo img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.mcd-reg-photo span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(0deg, rgba(139, 21, 16, 0.9), transparent);
  letter-spacing: 0.04em;
}

.mcd-redcard {
  flex: 1;
  padding: 18px 16px 20px;
  border-radius: 24px;
  background: var(--mcd-paper);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* ---- Shared form elements ---- */
.ea-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(218, 41, 28, 0.08);
  margin-bottom: 14px;
}

.ea-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--mcd-mute);
  transition: background 0.2s var(--ea-ease), color 0.2s var(--ea-ease);
}

.ea-tab.is-on {
  color: #fff;
  background: linear-gradient(180deg, #E8352B 0%, var(--mcd-red) 100%);
  box-shadow: 0 6px 14px rgba(218, 41, 28, 0.35);
}

.ea-hero__title {
  margin: 0;
  font-size: clamp(20px, 5vw, 24px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--mcd-ink);
}

.mf-auth--register .ea-hero__title {
  color: var(--mcd-ink);
}

.ea-hero__copy {
  margin: 5px 0 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--mcd-mute);
}

.mf-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mf-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid var(--mcd-line);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mf-field:focus-within {
  border-color: var(--mcd-yellow);
  box-shadow: 0 0 0 3px rgba(255, 199, 44, 0.25);
}

.mf-dial {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--mcd-red);
}

.mf-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--mcd-ink);
}

.mf-field input::placeholder {
  color: #aaa;
  font-weight: 600;
}

.mf-eye {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--mcd-mute);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.mf-eye svg { width: 18px; height: 18px; }
.mf-eye .eye-off { display: none; }
.mf-eye.is-on .eye-open { display: none; }
.mf-eye.is-on .eye-off { display: block; }

.mf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin-top: 4px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--mcd-ink);
  cursor: pointer;
  background: linear-gradient(180deg, var(--mcd-yellow-soft) 0%, var(--mcd-yellow) 50%, #E6A800 100%);
  box-shadow: 0 6px 0 #C98900, 0 10px 20px rgba(255, 199, 44, 0.35);
  transition: transform 0.1s var(--ea-ease);
}

.mf-btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #C98900, 0 6px 12px rgba(255, 199, 44, 0.25);
}

.mf-btn:disabled { opacity: 0.7; cursor: wait; }

.mf-foot {
  margin: 12px 0 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--mcd-mute);
}

.mf-foot a {
  color: var(--mcd-red);
  font-weight: 900;
  text-decoration: none;
}

.mf-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--ea-safe-b));
  transform: translateX(-50%) translateY(12px);
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--mcd-red-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ea-ease), transform 0.22s var(--ea-ease);
  z-index: 40;
}

.mf-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-height: 680px) {
  .mcd-reg-photo { max-height: 120px; }
  .mcd-reg-photo img { height: 120px; }
  .mcd-hero__logo img { width: 56px; height: 56px; }
  .mcd-bites img { width: 42px; height: 42px; }
  .mf-field { min-height: 44px; }
  .mf-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .mcd-bites img { animation: none; }
  .mf-btn { transition: none; }
}
