/*
 * Nextor Share — tokens visuais e componentes base.
 * Paleta, tipografia e proporções extraídas do site principal
 * (nextorfive.com.br) para manter a mesma identidade visual.
 */

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

:root {
  --orange: #ff6a13;
  --orange-2: #ff8c45;
  --bg: #0d0c0b;
  --surface: #181614;
  --surface-2: #1e1c1a;
  --border: #2a2724;
  --text: #f0eeec;
  --muted: #6b6560;
  --danger: #ff5c5c;
  --ok: #2ecc71;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --font: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;

  --focus-ring: 0 0 0 3px rgba(255, 106, 19, 0.45);
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* Grid sutil de fundo, igual ao site principal */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button, input {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Header comum                                                      */
/* ---------------------------------------------------------------- */
.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  height: 28px;
  width: auto;
}

.brand-name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.brand-name em {
  font-style: normal;
  color: var(--orange);
}

.product-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}

/* ---------------------------------------------------------------- */
/* Botões                                                            */
/* ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  transition: opacity .15s, transform .12s, background-color .15s, border-color .15s;
  white-space: nowrap;
}

.btn:hover { opacity: .92; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 1; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  border-color: rgba(255, 92, 92, 0.4);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(255, 92, 92, 0.08);
}

.btn-icon {
  padding: 10px;
  border-radius: var(--radius-sm);
}

/* Ícones SVG inline (ver public/assets/js/icons.js) — nunca emoji. O
   tamanho de exibição é controlado por contexto (botão, chip etc.). */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.btn-lg {
  padding: 16px 30px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* ---------------------------------------------------------------- */
/* Formulário                                                        */
/* ---------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.text-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 2px;
  text-transform: uppercase;
  width: 100%;
}

.text-input::placeholder {
  color: var(--muted);
  letter-spacing: normal;
  text-transform: none;
}

.text-input:focus {
  border-color: var(--orange);
}

/* ---------------------------------------------------------------- */
/* Badge / indicador ao vivo                                         */
/* ---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge-live {
  color: #fff;
  background: var(--danger);
  border-color: transparent;
}

.badge-live .badge-dot {
  animation: pulse-dot 1.6s ease-in-out infinite;
}

.badge-waiting {
  color: var(--orange);
  background: rgba(255, 106, 19, .08);
  border-color: rgba(255, 106, 19, .25);
}

.badge-waiting .badge-dot {
  animation: pulse-dot 2.2s ease-in-out infinite;
}

.badge-ended {
  color: var(--muted);
  background: var(--surface-2);
  border-color: var(--border);
}

.badge-ended .badge-dot {
  background: var(--muted);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

/* ---------------------------------------------------------------- */
/* Painel / superfície                                                */
/* ---------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------- */
/* Spinner de carregamento                                           */
/* ---------------------------------------------------------------- */
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------- */
/* Modal (dialog nativo)                                             */
/* ---------------------------------------------------------------- */
dialog.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 32px));
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-body {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

/* Cada etapa do modal (escolha do modo / orientação de áudio) reproduz o
   mesmo espaçamento em coluna do .modal-body, já que agora ficam
   aninhadas dentro do <form> em vez de serem filhas diretas dele. */
.modal-step {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-step[hidden] {
  display: none;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.audio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.audio-option:hover {
  border-color: rgba(255, 106, 19, .4);
}

.audio-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--orange);
  flex-shrink: 0;
}

.audio-option-text strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.audio-option-text span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.audio-warning {
  display: none;
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffb37a;
  background: rgba(255, 106, 19, .1);
  border: 1px solid rgba(255, 106, 19, .3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.audio-warning.is-visible {
  display: block;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.guide-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
}

.guide-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .site-header { padding: 16px; }
  .modal-body { padding: 20px; }
}
