/* ===== RESET & VARS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ---- Brand palette: Royal Heraldic VIP — deep purple velvet, gold crest, red ribbon accent ---- */
  --void:         #150A29;
  --purple-deep:  #2A1052;
  --purple:       #3D1A73;
  --purple-velvet:#200B3E;

  --gold:        #E8C97A;
  --gold-bright: #F5E3A8;
  --gold-deep:   #B8933E;
  --red:         #A31E2B;
  --red-deep:    #7A1420;

  --text:  #F5EFE0;
  --muted: #C4B3D9;
  --dim:   #8A76A8;

  --border:      rgba(232, 201, 122, 0.5);
  --border-soft: rgba(232, 201, 122, 0.25);

  --grad-gold: linear-gradient(135deg, #F5E3A8 0%, #E8C97A 45%, #B8933E 100%);
  --font-display: 'Prompt', sans-serif;
  --container-sm: 440px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Prompt', sans-serif;
  background:
    radial-gradient(90% 60% at 50% 0%, var(--purple) 0%, var(--purple-deep) 45%, var(--void) 100%);
  background-color: var(--void);
  color: var(--text);
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 88px;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ===== DIAMOND PATTERN OVERLAY ===== */
.damask {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.06;
  background-image:
    linear-gradient(45deg, var(--gold) 25%, transparent 25%),
    linear-gradient(-45deg, var(--gold) 25%, transparent 25%);
  background-size: 46px 46px;
}
.vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(80% 60% at 50% 30%, transparent 0%, rgba(21,10,41,0.55) 75%, rgba(21,10,41,0.9) 100%);
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(21, 10, 41, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
  box-shadow: 0 0 16px rgba(232,201,122,0.3);
}
.lang-btn svg { width: 100%; height: 100%; border-radius: 50%; }

/* ===== CENTER STAGE ===== */
.center-stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.25rem 1.25rem 1rem;
  position: relative;
  z-index: 2;
  text-align: center;
}
.crest-logo {
  width: min(46vw, 175px);
  height: auto;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5)) drop-shadow(0 0 30px rgba(232,201,122,0.25));
}

/* ===== ORNATE FRAME (the login card) ===== */
.ornate-frame {
  width: 100%;
  max-width: var(--container-sm);
  position: relative;
  border: 1px solid var(--border);
  padding: 3px;
  margin-top: 0.5rem;
}
.ornate-frame::before,
.ornate-frame::after,
.ornate-inner::before,
.ornate-inner::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gold);
  z-index: 3;
}
.ornate-frame::before { top: -3px; left: -3px; border-right: none; border-bottom: none; }
.ornate-frame::after { top: -3px; right: -3px; border-left: none; border-bottom: none; }
.ornate-inner::before { bottom: -3px; left: -3px; border-right: none; border-top: none; }
.ornate-inner::after { bottom: -3px; right: -3px; border-left: none; border-top: none; }

.ornate-inner {
  position: relative;
  background: linear-gradient(180deg, rgba(61,26,115,0.85) 0%, rgba(32,11,62,0.92) 100%);
  border: 1px solid var(--border-soft);
  padding: 1.75rem 1.5rem 1.5rem;
}

.login-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.ornate-inner form { width: 100%; }
.field {
  width: 100%;
  margin-bottom: 1rem;
  text-align: left;
}
.field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}
.field-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: rgba(21, 10, 41, 0.7);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0.85rem 1.1rem;
}
.field-input:focus-within { border-color: var(--gold); }
.field-input svg { flex-shrink: 0; color: var(--gold); width: 17px; height: 17px; }
.field-input input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
}
.field-input input::placeholder { color: var(--dim); }

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--grad-gold);
  color: #3A2A05;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.96rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid #fff3cf;
  border-radius: 6px;
  margin-top: 0.5rem;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    inset 0 -3px 4px rgba(120,90,10,0.35),
    0 10px 24px rgba(0,0,0,0.45);
  transition: transform 0.2s ease;
}
.btn-login:hover:not(:disabled) { transform: translateY(-2px); }
.btn-login svg { width: 18px; height: 18px; }
.btn-login:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.vip-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.vip-row a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--muted);
}
.vip-row a.line-btn { border-color: rgba(6,199,85,0.45); color: #B8FFD1; }
.vip-row .ico-line {
  display: inline-flex; align-items: center; justify-content: center;
  background: #06C755; color: #fff; font-size: 0.55rem; font-weight: 800;
  border-radius: 3px; padding: 1px 5px; line-height: 1.3;
}

.ribbon-badge {
  position: absolute;
  top: 14px;
  right: -8px;
  background: var(--red);
  color: var(--gold-bright);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.7rem 0.28rem 0.55rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  z-index: 4;
}

/* ===== ABOUT TEXT ===== */
.about-text {
  position: relative;
  z-index: 2;
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.5rem;
  text-align: center;
}
.about-text h2 {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.about-text p {
  font-size: 0.76rem;
  line-height: 1.85;
  color: var(--muted);
}

/* ===== BOTTOM NAV — raised shield center ===== */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--container-sm);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple-velvet) 100%);
  border-top: 1px solid var(--border);
  padding: 0.6rem 0.4rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.2rem;
  background: none;
  border: none;
}
.bn-item svg { width: 19px; height: 19px; color: var(--muted); }
.bn-item.active,
.bn-item:hover { color: var(--gold-bright); }
.bn-item.active svg,
.bn-item:hover svg { color: var(--gold-bright); }
.bn-item .ico-line {
  display: inline-flex; align-items: center; justify-content: center;
  background: #06C755; color: #fff; font-size: 0.52rem; font-weight: 800;
  border-radius: 3px; padding: 1px 4px; line-height: 1.3;
}

.bn-crest {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-16px);
}
.bn-crest .shield {
  width: 50px;
  height: 50px;
  clip-path: polygon(50% 0%, 100% 20%, 100% 65%, 50% 100%, 0% 65%, 0% 20%);
  background: var(--grad-gold);
  border: 2px solid var(--purple-velvet);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0,0,0,0.5);
  color: #3A2A05;
}
.bn-crest .shield svg { width: 22px; height: 22px; }
.bn-crest span { font-size: 0.6rem; font-weight: 800; color: var(--gold-bright); margin-top: 0.3rem; }

/* ===== HOW-TO MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(21, 10, 41, 0.82);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  width: 100%;
  max-width: var(--container-sm);
  background: var(--purple-velvet);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  transform: translateY(24px);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.modal-head h2 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--gold-bright);
}
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(232,201,122,0.15); border: 1px solid var(--border);
  color: var(--text); font-size: 1rem; display: flex; align-items: center; justify-content: center;
}
.modal-steps { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.modal-steps li { display: flex; gap: 0.75rem; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad-gold); color: #3A2A05; font-weight: 800; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-steps p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.modal-steps strong { color: var(--gold-bright); }
