@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Playfair+Display:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ha-navy: #1f2a44;
  --ha-navy-soft: #3a4663;
  --ha-muted: #8b93a7;
  --ha-line: rgba(255, 253, 248, 0.28);
  --ha-gold: #c9a227;
  --ha-gold-deep: #a07a14;
  --ha-gold-soft: #e8c96a;
  --ha-cream: #f7f1e4;
  --ha-sheet: #f4efe4;
  --ha-card: #fffdf8;
  --ha-ink-on-hero: #fffdf8;
  --ha-safe-top: env(safe-area-inset-top, 0px);
  --ha-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ha-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body.ha-auth {
  min-height: 100dvh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ha-ink-on-hero);
  background: #1a2030;
}

.ha-page {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      180deg,
      rgba(18, 28, 44, 0.18) 0%,
      rgba(18, 28, 44, 0.42) 42%,
      rgba(31, 42, 68, 0.82) 100%
    ),
    var(--ha-hero) center top / cover no-repeat;
  background-attachment: scroll;
}

.ha-hero {
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: transparent;
}

.ha-hero__veil {
  display: none;
}

.ha-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(14px + var(--ha-safe-top)) 20px 4px;
  text-align: center;
}

.ha-brand__mark {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
}

.ha-brand__name {
  margin: 2px 0 0;
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ha-gold-soft);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 20px rgba(201, 162, 39, 0.35);
}

.ha-brand__sub {
  margin: 2px 0 0;
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: rgba(255, 253, 248, 0.92);
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.ha-brand__tag {
  margin: 10px 0 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(255, 253, 248, 0.78);
  text-transform: uppercase;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.ha-brand__tag span {
  margin: 0 8px;
  color: var(--ha-gold-soft);
}

.ha-sheet {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 28px calc(24px + var(--ha-safe-bottom));
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.ha-sheet::after,
.ha-wave,
.ha-leaf {
  display: none;
}

.ha-title {
  margin: 0 0 4px;
  font-family: 'Great Vibes', cursive;
  font-size: 40px;
  font-weight: 400;
  color: var(--ha-gold-soft);
  text-align: center;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ha-lead {
  margin: 0 0 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 253, 248, 0.88);
  line-height: 1.45;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.ha-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(31, 42, 68, 0.55);
  border: 1px solid rgba(232, 201, 106, 0.35);
  color: #ffe8e8;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(6px);
}

.ha-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ha-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--ha-line);
}

.ha-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ha-gold-soft);
}

.ha-ico svg {
  width: 20px;
  height: 20px;
  display: block;
}

.ha-dial {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ha-ink-on-hero);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.ha-dial svg {
  width: 10px;
  height: 10px;
  color: rgba(255, 253, 248, 0.65);
}

.ha-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ha-ink-on-hero);
  padding: 8px 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.ha-field input::placeholder {
  color: rgba(255, 253, 248, 0.52);
  font-weight: 400;
}

.ha-eye {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: rgba(255, 253, 248, 0.55);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.ha-eye svg {
  width: 20px;
  height: 20px;
}

.ha-submit {
  margin-top: 22px;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #fffdf8;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, #e8c96a 0%, #c9a227 55%, #a07a14 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(160, 122, 20, 0.28);
  transition: transform 0.12s var(--ha-ease);
}

.ha-submit:active {
  transform: scale(0.98);
}

.ha-submit svg {
  width: 18px;
  height: 18px;
}

.ha-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.ha-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 253, 248, 0.82);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.ha-switch a {
  color: var(--ha-gold-soft);
  font-weight: 700;
  text-decoration: none;
}

.ha-foot {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ha-gold-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.ha-foot::before,
.ha-foot::after {
  content: '';
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 201, 106, 0.75), transparent);
}

body.ha-auth--register .ha-hero {
  min-height: clamp(170px, 30vh, 260px);
}

body.ha-auth--register .ha-brand__mark { width: 62px; height: 62px; }
body.ha-auth--register .ha-brand__name { font-size: 30px; }
body.ha-auth--register .ha-title { font-size: 36px; }
body.ha-auth--register .ha-lead { margin-bottom: 14px; }
body.ha-auth--register .ha-field { min-height: 44px; }
body.ha-auth--register .ha-submit { margin-top: 16px; }

@media (max-height: 740px) {
  .ha-hero { min-height: clamp(160px, 32vh, 240px); }
  .ha-brand__name { font-size: 28px; }
  .ha-title { font-size: 34px; }
}

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