/* ===================================================================
   SARRA BRASS - ATR (Análise Técnica Remota)
   Estilos compartilhados entre index, host e client
   =================================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #0e0e0e;
  color: #f2f2f2;
  min-height: 100vh;
}

header.atr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: #161616;
  border-bottom: 2px solid #c9a24b;
}

header.atr-header h1 {
  font-size: 28px;
  margin: 0;
  letter-spacing: 1px;
}

header.atr-header h1 .atr-destaque {
  font-size: 38px;
  font-weight: 800;
  margin-left: 4px;
}

header.atr-header .subtitle {
  font-size: 14px;
  color: #c9a24b;
  margin-top: 4px;
}

.ficha-atendimento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 20px;
  background: #161616;
  border: 1px solid #c9a24b;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 24px 0;
  font-size: 13px;
}

.ficha-atendimento div span.rotulo {
  display: block;
  color: #c9a24b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

.ficha-atendimento div span.valor {
  color: #f2f2f2;
  word-break: break-word;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

/* ---- Landing (index.html) ---- */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 24px;
  text-align: center;
  padding: 24px;
}

.landing .role-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

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

.btn-primary {
  background: #c9a24b;
  color: #111;
}

.btn-secondary {
  background: #2a2a2a;
  color: #f2f2f2;
  border: 1px solid #444;
}

.btn-danger {
  background: #a33232;
  color: #fff;
}

.btn-success {
  background: #2f8f4e;
  color: #fff;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Layout de chamada ---- */
.call-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 900px) {
  .call-layout.host {
    grid-template-columns: 3fr 1fr;
  }
}

.videos-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.video-box {
  position: relative;
  background: #1b1b1b;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid #2a2a2a;
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.video-box::before {
  content: "ATR SARRA BRASS";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c9a24b;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  padding: 12px;
  pointer-events: none;
  z-index: 0;
}

.video-box video,
.video-box .video-label,
.video-box .timestamp-overlay {
  position: relative;
  z-index: 1;
}

/* Cliente e host lado a lado, mesmo tamanho. */
.videos-area-desigual {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.videos-area-desigual .video-box {
  flex: 1;
  aspect-ratio: 4/3;
  min-height: 420px;
}

.videos-area-desigual .video-box-pequena {
  flex: 0 0 auto;
  width: 160px;
  aspect-ratio: 4/3;
  min-height: 0;
}

.coluna-cliente {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.video-label {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.timestamp-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.55);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---- Painel lateral (host) ---- */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-box {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 14px;
}

.panel-box h2 {
  font-size: 14px;
  margin: 0 0 10px 0;
  color: #c9a24b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timer-display {
  font-size: 42px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.timer-display.warning {
  color: #e0473e;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.row {
  display: flex;
  gap: 8px;
}

.row.wrap {
  flex-wrap: wrap;
}

input[type="text"], input[type="number"] {
  flex: 1;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #0e0e0e;
  color: #f2f2f2;
  font-size: 14px;
}

form label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  color: #ccc;
}

form label input[type="text"],
form label textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #0e0e0e;
  color: #f2f2f2;
  font-size: 14px;
  font-family: inherit;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #1c1c1c;
  border: 1px solid #c9a24b;
  border-radius: 6px;
  padding: 12px;
}

.checkbox-line input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  accent-color: #c9a24b;
}


.status-line {
  font-size: 13px;
  color: #999;
  margin-top: 6px;
}

.link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-box input {
  font-size: 13px;
}

/* ---- Alerta de fim de sessão ---- */
.session-end-overlay {
  position: fixed;
  inset: 0;
  background: rgba(160, 20, 20, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  padding: 20px;
}

.session-end-overlay.show {
  display: flex;
}

/* ---- Aviso anti-gravação (client) ---- */
.anti-record-warning {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #a33232;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.anti-record-warning.show {
  opacity: 1;
}

.fora-escopo-flash {
  position: fixed;
  inset: 0;
  background: rgba(163, 20, 20, 0.55);
  border: 8px solid #a31414;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.fora-escopo-flash.show {
  opacity: 1;
  animation: pisca-fora-escopo 0.5s ease-in-out 2;
}

@keyframes pisca-fora-escopo {
  0%, 100% { background: rgba(163, 20, 20, 0.55); }
  50% { background: rgba(163, 20, 20, 0.9); }
}

.indicador-gravando {
  color: #ff4d4d;
  font-size: 13px;
  font-weight: 700;
  margin-left: 10px;
  animation: pisca-gravando 1s ease-in-out infinite;
}

@keyframes pisca-gravando {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.small-note {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}
