/* SMS Panel — dark-luxury system
 * Black-on-black with gold ledger-readout typography.
 * Match: activkode + CLASS DECOR identity (Cinzel / DM Sans / JetBrains Mono).
 */

/* Forțează atributul HTML `hidden` peste orice display custom (flex/grid/block).
   Fără asta, .waiting-indicator { display: flex } trece peste [hidden]. */
[hidden] { display: none !important; }

:root {
  --bg:          #0a0a0a;
  --bg-elev:    #111111;
  --bg-elev-2: #161616;
  --line:       #1f1f1f;
  --line-soft: #181818;
  --gold:       #C9A84C;
  --gold-soft: #9c823a;
  --gold-glow: rgba(201, 168, 76, 0.18);
  --ink:        #ededed;
  --ink-soft:  #8a8a8a;
  --ink-faint: #5a5a5a;
  --danger:    #c8463a;
  --ok:        #6cae6f;
  --warn:      #d2a13a;

  --radius:    14px;
  --radius-sm: 8px;

  --t-serif:   'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --t-body:    'DM Sans', system-ui, sans-serif;
  --t-mono:    'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--t-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  /* subtle grain */
  background-image:
    radial-gradient(ellipse at top, rgba(201,168,76,0.05), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(201,168,76,0.03), transparent 60%);
}

/* ───────────────── DENIED screen ───────────────── */

.screen-denied {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.denied-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 48px 40px;
  border-radius: var(--radius);
  text-align: center;
  max-width: 380px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.denied-mark {
  font-size: 56px;
  color: var(--danger);
  line-height: 1;
  margin-bottom: 16px;
  font-family: var(--t-mono);
}

.denied-card h1 {
  font-family: var(--t-serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  color: var(--ink);
}

.denied-card p {
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.denied-card .hint {
  color: var(--ink-faint);
  font-size: 13px;
  margin-top: 18px;
}

/* ───────────────── APP screen ───────────────── */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 10px; height: 10px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--gold-glow);
}
.brand-name {
  font-family: var(--t-serif);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--gold);
}

.topbar-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-soft);
}
.meta-item { display: inline-flex; align-items: center; gap: 8px; }
.meta-item strong { color: var(--ink); font-weight: 500; font-family: var(--t-mono); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(108,174,111,0.5);
}
.dot.warn { background: var(--warn); box-shadow: 0 0 8px rgba(210,161,58,0.5); }
.dot.err  { background: var(--danger); box-shadow: 0 0 8px rgba(200,70,58,0.5); }

.screen-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  position: relative;
}

.card-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-meta {
  font-family: var(--t-mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0;
  text-transform: none;
}

/* Number — large ledger readout */
.number {
  font-family: var(--t-mono);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  word-break: break-all;
  text-shadow: 0 0 30px var(--gold-glow);
}
.number[data-empty="true"] {
  color: var(--ink-faint);
  text-shadow: none;
}

.copy-btn {
  position: absolute;
  top: 28px;
  right: 32px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
  font-family: var(--t-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.15s;
}
.copy-btn:hover { color: var(--gold); border-color: var(--gold-soft); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* Code card — even bigger */
.code-card .code {
  font-family: var(--t-mono);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  line-height: 1;
  padding: 8px 0;
  word-break: break-all;
}
.code-card[data-state="ready"] {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 1px var(--gold-soft), 0 30px 80px -30px var(--gold-glow);
}
.code-card[data-state="ready"] .code {
  color: var(--gold);
  text-shadow: 0 0 40px var(--gold-glow);
  animation: codeReveal 0.5s ease-out;
}

@keyframes codeReveal {
  0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.waiting-indicator {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warn);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.2); box-shadow: 0 0 12px var(--warn); }
}

/* Actions */
.actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin: 6px 0;
}

.btn {
  font-family: var(--t-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 18px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gold);
  color: #0a0a0a;
  border-color: var(--gold);
  font-weight: 700;
}
.btn-primary:hover:not(:disabled) {
  background: #d8b755;
  box-shadow: 0 12px 40px var(--gold-glow);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--ink-soft);
}
.btn-secondary:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink-soft);
}

.btn-kbd {
  font-family: var(--t-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  color: #0a0a0a;
  opacity: 0.6;
  letter-spacing: 0;
  text-transform: none;
}

/* History */
.history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.history li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 14px;
  align-items: baseline;
}
.history li:last-child { border-bottom: 0; }
.history-empty {
  color: var(--ink-faint) !important;
  font-style: italic;
  border-bottom: 0 !important;
  display: block !important;
}

.h-phone   { font-family: var(--t-mono); color: var(--ink); font-size: 13px; }
.h-code    { font-family: var(--t-mono); color: var(--gold); font-weight: 700; }
.h-service { color: var(--ink-soft); font-size: 12px; letter-spacing: 0.06em; }
.h-time    { color: var(--ink-faint); font-size: 11px; font-family: var(--t-mono); }

/* Mobile */
@media (max-width: 540px) {
  .topbar { padding: 14px 18px; }
  .topbar-meta { gap: 14px; font-size: 12px; }
  .screen-app { padding: 24px 14px 60px; gap: 14px; }
  .card { padding: 22px 20px; }
  .copy-btn { top: 22px; right: 20px; }
  .number { font-size: 28px; }
  .code-card .code { font-size: 44px; }
  .actions { grid-template-columns: 1fr; }
  .btn-kbd { display: none; }
  .history li { grid-template-columns: 1fr auto; }
  .history li .h-service, .history li .h-time { display: none; }
}

/* Admin overrides — minimal reuse */
.admin-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.admin-page h1 {
  font-family: var(--t-serif);
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-bottom: 28px;
  color: var(--gold);
  font-size: 24px;
}
.admin-page h2 {
  font-family: var(--t-body);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 28px 0 14px;
}

.link-output {
  background: var(--bg-elev-2);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}
.link-output input {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--gold);
  font-family: var(--t-mono);
  font-size: 13px;
  padding: 8px 0;
}
.link-output .meta {
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 8px;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.admin-table th {
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.admin-table td.mono { font-family: var(--t-mono); color: var(--ink-soft); }
.admin-table .btn { padding: 6px 12px; font-size: 11px; }

.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.notice.ok    { background: rgba(108,174,111,0.08); color: var(--ok); border: 1px solid rgba(108,174,111,0.3); }
.notice.error { background: rgba(200,70,58,0.08); color: var(--danger); border: 1px solid rgba(200,70,58,0.3); }
