/* VIP Server — customer app. Theme variables come from /theme.css (config.json). */
:root {
  --bg: #0a0a0a; --surface: #141414; --gold: #d4af37; --text: #fff;
}
:root {
  --surface-2: #1b1b1b;
  --line: rgba(212, 175, 55, .18);
  --line-soft: rgba(255, 255, 255, .08);
  --muted: rgba(255, 255, 255, .62);
  --gold-hi: #f1d77a;
  --gold-grad: linear-gradient(135deg, #f3dc86 0%, var(--gold) 45%, #a8841f 100%);
  --danger: #ff6b6b;
  --ok: #57d68d;
  --wa: #25d366;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(212, 175, 55, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 .75em; }
a { color: var(--gold); }
b { color: var(--text); font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

#app {
  max-width: 480px; margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 18px calc(28px + var(--safe-bottom));
}
.view { animation: fade .25s ease; }
.view-center { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.view-center .btn { width: 100%; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.logo { width: 92px; height: 92px; border-radius: 50%; display: block; filter: drop-shadow(0 6px 24px rgba(212, 175, 55, .25)); }
.logo-lg { width: 132px; height: 132px; }
.logo-sm { width: 44px; height: 44px; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; transform: scale(.96); } }

.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0 22px; }
.hero-sm { margin-bottom: 18px; }
.hero h1 { margin-top: 10px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.panel { display: flex; flex-direction: column; gap: 14px; }

.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 12px 18px; border-radius: 14px;
  font: inherit; font-weight: 650; letter-spacing: .01em;
  transition: transform .08s ease, filter .15s ease, opacity .15s;
  width: 100%; margin-top: 8px;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.btn-gold { background: var(--gold-grad); color: #111; box-shadow: 0 6px 22px rgba(212, 175, 55, .28); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-outline { background: transparent; color: var(--gold); border: 1px solid var(--line); }
.btn-wa { background: var(--wa); color: #06260f; }
.btn-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .925rem; padding: 12px; margin: 6px auto 0; display: block; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-soft); width: 40px; height: 40px; border-radius: 12px; font-size: 1.1rem; cursor: pointer; flex: none; }

.wa-ico { width: 22px; height: 22px; flex: none; background: currentColor;
  -webkit-mask: url(/icons/whatsapp.svg) center/contain no-repeat; mask: url(/icons/whatsapp.svg) center/contain no-repeat; }

/* Forms */
.form { display: flex; flex-direction: column; }
.label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 6px; display: block; }
.form .label:first-child { margin-top: 0; }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px;
  background: #0d0d0d; color: var(--text); border: 1px solid var(--line-soft);
  font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, .18); }
.input::placeholder { color: rgba(255, 255, 255, .3); }
.pin { letter-spacing: .5em; text-align: center; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phone-field { display: flex; gap: 8px; }
.cc-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 50px; padding: 0 12px;
  background: #0d0d0d; color: var(--text); border: 1px solid var(--line-soft); border-radius: 12px; font: inherit; cursor: pointer;
}
.cc-btn::after { content: '▾'; color: var(--muted); font-size: .8em; }
.flag { font-size: 1.25em; line-height: 1; }
.error { color: var(--danger); font-size: .925rem; margin: 12px 0 0; }
.note { font-size: .9rem; color: var(--muted); margin: 10px 0 0; }
.note.ok { color: var(--ok); text-align: center; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.tab { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px; border-radius: 10px; cursor: pointer; }
.tab.active { background: var(--surface-2); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line); }

/* Steps */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 8px 0 8px 40px; color: var(--muted); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 7px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #111; background: var(--gold-grad);
}
.steps.small li { font-size: .9rem; }
.ios-share, .ios-add { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-soft); vertical-align: -6px; color: #4aa3ff; font-size: .8rem; }
.ios-arrow { text-align: center; font-size: 1.8rem; color: var(--gold); animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }
.copy-row { display: flex; gap: 8px; }
.copy-row .btn { width: auto; margin: 0; white-space: nowrap; }

/* Status screens */
.status-icon { font-size: 2.2rem; margin: 14px 0 2px; }

/* Dashboard */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar-text { flex: 1; min-width: 0; }
.greeting { font-size: 1.2rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-card { border-color: rgba(212, 175, 55, .35); background: radial-gradient(120% 120% at 100% 0%, rgba(212,175,55,.16), transparent 55%), var(--surface); }
.sub-head { display: flex; justify-content: space-between; align-items: center; }
.sub-head .label { margin: 0; }
.badge { font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.badge-active { color: var(--ok); background: rgba(87, 214, 141, .12); border: 1px solid rgba(87, 214, 141, .3); }
.sub-expiry { font-size: 1.35rem; font-weight: 700; margin-top: 10px; }
.sub-expiry.warn { color: var(--danger); }
.sub-days { font-size: .9rem; min-height: 1em; }
.wa-ico.dark { color: #111; }

.push-row { display: flex; gap: 12px; align-items: flex-start; }
.push-ico { font-size: 1.6rem; line-height: 1; }
.push-text h3 { margin-bottom: 2px; }
.push-text p { margin: 0; }
.push-card.on { border-color: rgba(87, 214, 141, .3); }
.push-card #push-blocked { margin-top: 10px; }

.section-title { font-size: .8rem; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; margin: 22px 2px 10px; }
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.support-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line-soft); color: var(--text); text-decoration: none; font-size: .85rem; font-weight: 600;
}
.support-btn .s-ico { font-size: 1.4rem; line-height: 1; }
.support-btn:active { transform: scale(.97); }

.news-list { display: flex; flex-direction: column; gap: 12px; }
.post { padding: 0; overflow: hidden; margin: 0; }
.post img { width: 100%; display: block; max-height: 360px; object-fit: cover; background: #111; }
.post-body { padding: 16px 18px 18px; }
.post-meta { display: flex; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.pin-badge { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.post h3 { font-size: 1.1rem; }
.post-text { white-space: pre-wrap; word-wrap: break-word; color: rgba(255,255,255,.82); margin: 0; }
.post.pinned { border-color: rgba(212, 175, 55, .45); }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

/* Sheets */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet {
  width: 100%; max-width: 480px; max-height: 86dvh; display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom));
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { margin: 0; }
.cc-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 200px; }
.cc-list li { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.cc-list li:active, .cc-list li.sel { background: rgba(212, 175, 55, .08); }
.cc-list .cc-name { flex: 1; }
.cc-list .cc-dial { color: var(--muted); font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%);
  background: #222; color: var(--text); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 60;
  font-size: .925rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); max-width: calc(100% - 32px); text-align: center;
}
