/* ============================================================
   GT HASO VIP Mini App — Space Gray Titanium & Animated Glass
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0d0e12;
  --card-bg: rgba(20, 23, 31, 0.88);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue-glow: #38bdf8;
  --blue-royal: #2563eb;
  --titan-silver: rgba(226, 232, 240, 0.25);
  --danger: #ef4444;
  --ok: #22c55e;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- Dynamisch Animierte Hintergrund-Farben (Floating Light Mesh) --- */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(37, 99, 235, 0.2) 60%, transparent 100%);
  top: -120px;
  right: -90px;
  animation: bgFloat1 14s ease-in-out infinite alternate;
}
.bg-glow-2 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(148, 163, 184, 0.22) 0%, rgba(30, 41, 59, 0.15) 70%, transparent 100%);
  bottom: -110px;
  left: -90px;
  animation: bgFloat2 18s ease-in-out infinite alternate;
}
.bg-glow-3 {
  position: fixed;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.25) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: bgFloat3 12s ease-in-out infinite alternate;
}

@keyframes bgFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-40px, 50px) scale(1.15); }
  100% { transform: translate(30px, 20px) scale(0.95); }
}
@keyframes bgFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -40px) scale(1.12); }
  100% { transform: translate(-20px, -20px) scale(1); }
}
@keyframes bgFloat3 {
  0% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.45; transform: translate(-40%, -60%) scale(1.2); }
  100% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.9); }
}

/* --- Layout Shell --- */
.shell {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
  padding: 24px 20px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header / Branding --- */
.brand { text-align: center; margin-bottom: 20px; animation: fadeDown 0.5s ease both; }

.app-logo-box {
  display: inline-flex;
  padding: 4px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.25), inset 0 0 15px rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.app-logo-img {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
}

.brand h1 { font-size: 24px; letter-spacing: 3px; font-weight: 800; color: #ffffff; }
.brand h1 span { color: var(--blue-glow); }
.tagline { color: var(--muted); font-size: 12.5px; margin-top: 4px; letter-spacing: 1px; }

/* ============================================================
   ANIMIERTER LEUCHT-RAND UM DAS FENSTER (CARD WRAPPER)
   ============================================================ */
.animated-card-wrap {
  position: relative;
  border-radius: 22px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(56, 189, 248, 0.6), rgba(255, 255, 255, 0.08), rgba(37, 99, 235, 0.7));
  background-size: 300% 300%;
  animation: borderGlow 6s ease infinite, fadeUp 0.5s ease both;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.15);
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Titan-Glas Karte --- */
.card {
  position: relative;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20.5px;
  padding: 22px 20px;
  overflow: hidden;
}

/* Metallischer Glanz-Reflex auf dem Karten-Header */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.greet { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 18px; }
.hint b { color: var(--text); }

/* --- Eingabefeld mit Metall- & Glasakzenten --- */
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--blue-glow);
  margin-bottom: 8px;
  font-weight: 700;
}
#account {
  width: 100%;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  background: rgba(11, 14, 21, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
#account:focus {
  border-color: var(--blue-glow);
  background: rgba(13, 17, 26, 0.95);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3), inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
#account::placeholder { color: #475569; font-weight: 500; }

/* --- Primary CTA Button mit Glasmorphismus & Glanz --- */
.cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #2563eb, #0284c7);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s, box-shadow 0.2s;
  text-decoration: none;
  overflow: hidden;
}
.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
  pointer-events: none;
}
.cta:active { transform: scale(0.98); }
.cta:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.cta.loading .cta-label { visibility: hidden; }
.cta-spinner {
  display: none;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.cta.loading .cta-spinner { display: block; }
.cta-link {
  margin-top: 6px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 6px 24px rgba(56, 189, 248, 0.35);
}

.ghost {
  width: 100%;
  margin-top: 12px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  border-radius: 14px;
  padding: 13px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.danger-ghost {
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger);
  margin-top: 8px;
}
.danger-ghost:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.fineprint { color: #64748b; font-size: 11px; text-align: center; margin-top: 14px; line-height: 1.5; }

/* --- Ergebnis-Karte --- */
.result { text-align: center; }
.result-icon { font-size: 44px; margin-bottom: 10px; animation: pop 0.4s ease both; }
.result h2 { font-size: 19px; margin-bottom: 8px; }
.result p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.result p b { color: var(--text); }

/* --- Account Overview Card --- */
.account-card {
  background: rgba(11, 15, 25, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
  text-align: left;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.15);
}
.account-header {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--blue-glow);
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
}
.account-row:last-child { margin-bottom: 0; }
.account-label { color: var(--muted); }
.account-value { font-weight: 700; color: var(--text); }
.account-value.accent { color: var(--blue-glow); font-size: 15px; }
.account-badge {
  background: rgba(34, 197, 94, 0.15);
  color: var(--ok);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.hidden { display: none !important; }

/* --- Footer & Legal Button --- */
.foot {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  color: #64748b;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.legal-btn {
  background: none;
  border: none;
  color: var(--blue-glow);
  font-size: 11px;
  margin-top: 6px;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.legal-btn:hover { opacity: 1; }

/* --- Modal Glassmorphism --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 17, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeUp 0.25s ease-out;
}

.modal-content {
  max-width: 440px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow: hidden;
  background: rgba(20, 23, 31, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 35px rgba(56,189,248,0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.modal-header h2 { font-size: 16px; font-weight: 800; color: var(--blue-glow); margin: 0; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  overflow-y: auto;
  padding-right: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE & Edge */
}
.modal-body::-webkit-scrollbar {
  width: 0px;
  height: 0px;
  display: none; /* Chrome, Safari, Telegram Desktop */
}

.modal-body h3 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin: 14px 0 6px 0;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 10px; }

/* Global Scrollbar Customization */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.5);
}

.modal-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* --- Animations --- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Zweiter Aktionsknopf in der Ergebniskarte + mehrzeilige Ergebnistexte */
a.ghost { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
#result-text { white-space: pre-line; text-align: left; }
