:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface2: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --success: #34d399;
  --error: #f87171;
  --radius: 20px;
  --shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

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

html, body {
  min-height: 100%;
}

body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56, 189, 248, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(129, 140, 248, 0.12), transparent);
}

.app {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  min-height: 100dvh;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #0f172a;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 2px;
}

.scan-panel {
  text-align: center;
  padding: 28px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.scan-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(56, 189, 248, 0.08);
  border: 2px solid rgba(56, 189, 248, 0.25);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.scan-ring.active {
  animation: pulse 1.6s ease-in-out infinite;
  border-color: var(--accent);
  box-shadow: 0 0 0 8px rgba(56, 189, 248, 0.12);
}

.scan-ring.success {
  border-color: var(--success);
  background: rgba(52, 211, 153, 0.1);
  animation: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.nfc-icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
}

.scan-hint {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 24px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: #0f172a;
  width: 100%;
  max-width: 280px;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  padding: 12px 18px;
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.manual {
  margin-bottom: 16px;
}

.manual-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.manual-row {
  display: flex;
  gap: 10px;
}

.input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--surface2);
  background: var(--surface);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

.input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status {
  min-height: 24px;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 16px;
}

.status.info { color: var(--muted); }
.status.error { color: var(--error); }
.status.ok { color: var(--success); }

.result.hidden {
  display: none;
}

.card-client,
.card-phones {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  margin-bottom: 14px;
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 8px;
}

.client-name {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.client-meta {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.phone-list {
  list-style: none;
}

.phone-list li {
  margin-bottom: 10px;
}

.phone-list li:last-child {
  margin-bottom: 0;
}

.phone-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phone-link:hover {
  background: rgba(56, 189, 248, 0.14);
}

.phone-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.details-raw {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.details-raw summary {
  cursor: pointer;
  padding: 8px 0;
}

.details-raw pre {
  margin-top: 8px;
  padding: 12px;
  background: #020617;
  border-radius: 12px;
  overflow: auto;
  font-size: 0.7rem;
  line-height: 1.4;
  max-height: 240px;
}
