@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Great+Vibes&family=Playfair+Display:wght@600;700;800&family=Nunito:wght@600;700;800;900&display=swap');

:root {
  --ea-green: #163a2c;
  --ea-green-deep: #0e261c;
  --ea-green-mid: #1f4d3a;
  --ea-gold: #c9a45c;
  --ea-gold-soft: #e8d5a3;
  --ea-cream: #f7f1e6;
  --ea-paper: #fffdf8;
  --ea-ink: #1c2a24;
  --ea-mute: #6d7a73;
  --ea-line: #e6dccb;
  --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);
  --ea-form-w: min(100%, 318px);
  --ea-side-pad: 28px;
}

* { 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(--ea-ink);
  background-color: #f7f1e6;
  overflow: hidden;
  -webkit-overflow-scrolling: auto;
}

body.mf-auth--register {
  background-color: #14261c;
}

.mf-wrap {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding:
    calc(10px + var(--ea-safe-t))
    max(var(--ea-side-pad), env(safe-area-inset-left))
    calc(10px + var(--ea-safe-b))
    max(var(--ea-side-pad), env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

.ea-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}

.ea-photo-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(247, 241, 230, 0.1) 28%,
    rgba(247, 241, 230, 0.42) 52%,
    rgba(247, 241, 230, 0.72) 100%
  );
}

.mf-auth--register .ea-photo-fade {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(20, 38, 28, 0.22) 24%,
    rgba(20, 38, 28, 0.42) 48%,
    rgba(247, 241, 230, 0.72) 78%,
    rgba(247, 241, 230, 0.9) 100%
  );
}

.ea-brand {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: var(--ea-form-w);
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 0 4px 4px;
  color: #f8efd8;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.mf-auth--login .ea-brand {
  color: #5a4318;
}

.ea-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 4px;
  display: grid;
  place-items: center;
  background: transparent;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.ea-mark svg,
.ea-mark img {
  width: 62px;
  height: 62px;
  display: block;
  object-fit: contain;
}

.ea-brand__name {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(21px, 5.2vw, 25px);
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.05;
  color: #d8b56a;
  text-indent: 0.14em;
}

.mf-auth--login .ea-brand__name {
  color: #b68a2e;
  text-shadow: 0 1px 0 #fff6dc, 0 8px 18px rgba(120, 80, 20, 0.18);
}

.mf-auth--register .ea-brand__name {
  color: #e8d08a;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.ea-brand__sub {
  margin: 4px 0 0;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(232, 208, 138, 0.88);
}

.mf-auth--login .ea-brand__sub {
  color: #8a7040;
}

.ea-brand__tag {
  margin: 5px 0 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: rgba(255, 246, 220, 0.92);
}

.mf-auth--login .ea-brand__tag {
  color: #6a5830;
}

.ea-sheet {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: var(--ea-form-w);
  max-width: 100%;
  margin:
    10px auto 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.mf-auth--register .ea-sheet {
  margin-top: 8px;
}

.ea-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(243, 238, 228, 0.82);
  backdrop-filter: blur(6px);
  margin-bottom: 10px;
}

.ea-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
  color: #6f7b74;
}

.ea-tab svg {
  width: 14px;
  height: 14px;
}

.ea-tab.is-on {
  color: #fff;
  background: linear-gradient(180deg, #245744 0%, var(--ea-green) 100%);
  box-shadow: 0 8px 16px rgba(22, 58, 44, 0.28);
}

.ea-hero__title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(19px, 4.8vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.12;
  color: var(--ea-ink);
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.75);
}

.ea-hero__title em {
  font-family: 'Great Vibes', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 1.08em;
  color: var(--ea-green);
  margin-left: 3px;
}

.ea-hero__copy {
  margin: 4px 0 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  color: #4f5c55;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.7);
}

.mf-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mf-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--ea-line);
  box-shadow: 0 2px 8px rgba(20, 30, 22, 0.08);
}

.mf-field:focus-within {
  border-color: rgba(201, 164, 92, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.16);
}

.mf-field > svg,
.mf-dial svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ea-green);
}

.mf-dial {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--ea-ink);
}

.mf-dial svg {
  width: 10px;
  height: 10px;
  color: var(--ea-mute);
}

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

.mf-field input::placeholder {
  color: #9aa59e;
  font-weight: 700;
}

.mf-eye {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--ea-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-captcha {
  flex-shrink: 0;
  min-width: 88px;
  padding: 6px 8px;
  border-radius: 999px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
  color: var(--ea-green);
  background: #f4ecda;
  border: 1px solid #e4d7b8;
  user-select: none;
}

.mf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border: 1px solid #c9a45c;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #2a6148 0%, var(--ea-green) 55%, var(--ea-green-deep) 100%);
  box-shadow:
    0 6px 14px rgba(14, 38, 28, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.mf-btn:active { transform: translateY(1px); }
.mf-btn:disabled { opacity: 0.7; cursor: wait; }
.mf-btn svg { width: 16px; height: 16px; }

.mf-foot {
  margin: 6px 0 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #4f5c55;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.7);
}

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

.ea-perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(230, 220, 203, 0.65);
}

.ea-perk {
  text-align: center;
  color: #7a6538;
}

.ea-perk svg {
  width: 14px;
  height: 14px;
  margin: 0 auto 3px;
  display: block;
}

.ea-perk span {
  display: block;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.65);
}

.ea-sign {
  margin: 4px 0 0;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9a8458;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.65);
}

.mf-auth--register .ea-brand__sub {
  color: #f3e4b8;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.mf-auth--register .ea-brand__tag {
  font-size: 10.5px;
  line-height: 1.2;
  color: #fff4d6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.mf-auth--register .ea-hero__title {
  font-size: clamp(18px, 4.5vw, 21px);
  color: #fff8ee;
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.72),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.mf-auth--register .ea-hero__title em {
  color: #f0d78a;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.mf-auth--register .ea-hero__copy {
  margin-bottom: 8px;
  color: #f2ead8;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.68);
}

.mf-auth--register .mf-foot {
  color: #f0ead8;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.62);
}

.mf-auth--register .mf-foot a {
  color: #ffe9a8;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.mf-auth--register .ea-perks {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.mf-auth--register .ea-perk {
  color: #f3e4b8;
}

.mf-auth--register .ea-perk svg {
  color: #f3e4b8;
  stroke: #f3e4b8;
}

.mf-auth--register .ea-perk span {
  color: #f8efd8;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.62);
}

.mf-auth--register .ea-sign {
  color: #e8d5a3;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.mf-auth--register .ea-tabs {
  background: rgba(255, 252, 245, 0.9);
}

.mf-auth--register .mf-form {
  gap: 7px;
}

.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: rgba(14, 38, 28, 0.94);
  color: #fff8ee;
  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: 700px) {
  :root {
    --ea-form-w: min(100%, 300px);
  }

  .mf-wrap {
    padding-top: calc(6px + var(--ea-safe-t));
    --ea-side-pad: 24px;
  }

  .ea-mark,
  .ea-mark svg,
  .ea-mark img {
    width: 52px;
    height: 52px;
  }

  .ea-brand__name {
    font-size: 19px;
    letter-spacing: 0.12em;
  }

  .ea-brand__tag {
    font-size: 10px;
    margin-top: 3px;
  }

  .ea-sheet {
    margin-top: 6px;
  }

  .ea-tabs { margin-bottom: 8px; }

  .ea-hero__title { font-size: 17px; }

  .ea-hero__copy {
    font-size: 10px;
    margin-bottom: 7px;
  }

  .mf-form { gap: 6px; }

  .mf-field { min-height: 40px; }

  .mf-btn { min-height: 40px; }

  .ea-perks {
    margin-top: 5px;
    padding-top: 5px;
  }
}

@media (max-width: 360px) {
  :root {
    --ea-form-w: 100%;
    --ea-side-pad: 22px;
  }
}

@media (max-height: 620px) {
  .ea-brand__tag {
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ea-perk span { font-size: 6.5px; }
}

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