:root{
  --navy-deep: #081426;
  --navy: #0d2440;
  --teal: #2fc6c6;
  --teal-soft: #7fe0e0;
  --green: #3ecf7e;
  --amber: #f0c14b;
  --white: #ffffff;
}

*{ box-sizing: border-box; }

body{
  margin:0;
  background: var(--navy-deep);
  color: var(--white);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

/* ===== Topbar ===== */
.topbar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  background: var(--navy);
  padding: 12px 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-left h1{
  font-size: 20px;
  margin: 0;
  font-weight: 800;
}

.assinatura{
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  font-style: italic;
}

.topbar-right{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

select, button, input[type="text"], textarea, input[type="color"]{
  font-family: inherit;
}

#seletorModelo{
  background: var(--navy-deep);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
}

.topbar-left button{
  background: transparent;
  border: none;
  color: var(--white);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
}
.topbar-left button:hover{ background: rgba(255,255,255,0.08); }

.btn-primario{
  background: var(--teal);
  color: var(--navy-deep);
  border: none;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secundario{
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* ===== Layout geral ===== */
.app-body{
  display:flex;
  min-height: calc(100vh - 60px);
}

.painel{
  width: 380px;
  flex-shrink:0;
  background: var(--navy);
  padding: 16px;
  overflow-y:auto;
  max-height: calc(100vh - 60px);
}

.painel h3{
  font-size: 14px;
  margin: 18px 0 8px;
  color: var(--white);
}

.editando-label{
  color: rgba(255,255,255,0.54);
  font-size: 12px;
}

.linha-flex{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.linha-flex-space{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-top: 18px;
}

.cor-linha{
  display:flex;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

input[type="color"]{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.24);
  padding: 0;
  background: none;
  cursor: pointer;
}

label{
  display:block;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-top: 10px;
  margin-bottom: 4px;
}

input[type="text"], textarea{
  width: 100%;
  background: var(--navy-deep);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
}

.btn-upload{
  width:100%;
  background: rgba(255,255,255,0.06);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px;
  border-radius: 8px;
  cursor:pointer;
  font-size: 13px;
}

.btn-link{
  background:none;
  border:none;
  color: var(--teal-soft);
  font-size: 12px;
  cursor:pointer;
  padding: 4px 0;
}

/* switch estilo iOS */
.switch{ position:relative; display:inline-block; width:36px; height:20px; }
.switch input{ opacity:0; width:0; height:0; }
.slider{
  position:absolute; cursor:pointer; inset:0;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  transition: .2s;
}
.slider:before{
  content:""; position:absolute; height:14px; width:14px; left:3px; bottom:3px;
  background: white; border-radius:50%; transition:.2s;
}
.switch input:checked + .slider{ background: var(--teal); }
.switch input:checked + .slider:before{ transform: translateX(16px); }

/* ===== Card editor (sidebar) ===== */
.card-editor{
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.card-editor-top{
  display:flex;
  align-items:center;
  gap: 6px;
  margin-bottom: 6px;
}
.card-editor-top input[type="text"]{ flex:1; }
.card-cor-dot{
  width: 26px; height:26px; border-radius:50%;
  border: 1px solid rgba(255,255,255,0.24);
  cursor:pointer; flex-shrink:0;
}
.card-icone-btn{
  width: 26px; height:26px; border-radius:50%;
  background: rgba(255,255,255,0.1);
  border:none; color:white; cursor:pointer; flex-shrink:0;
  font-size: 13px;
}
.btn-remover-card{
  background:none; border:none; color:#e0555a; cursor:pointer; font-size:16px;
}
.linha-editor{
  display:flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items:flex-start;
}
.linha-editor textarea{ flex:1; }
.btn-remover-linha{
  background:none; border:none; color:#e0555a; cursor:pointer; font-size:14px; margin-top:6px;
}
.dica-negrito{
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 6px;
}

/* ===== Preview ===== */
.preview{
  flex:1;
  padding: 24px;
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 40px;
  overflow:auto;
}

.poster{
  border-radius: 14px;
  position: relative;
}

.poster-email{
  width: 650px;
  padding: 28px 30px 32px;
}

.poster-tv{
  width: 960px;
  height: 540px;
  padding: 28px 35px;
  overflow:hidden;
}

.poster-logo{ height:44px; display:block; }
.poster-pill{
  display:inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}
.poster-titulo{
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  white-space: pre-line;
}
.poster-subtitulo{
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
}
.poster-icone-wrap{
  width: 92px; height:92px;
  border-radius:50%;
  border: 2px solid;
  display:flex; align-items:center; justify-content:center;
  margin: 0 auto;
}
.poster-icone-wrap img{ width:52px; height:52px; border-radius:50%; object-fit:cover; }
.poster-icone-wrap .material-fallback{ font-size: 40px; }

.poster-card{
  border: 1.5px solid;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.poster-card-titulo{
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}
.poster-card-linha{
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
  display:flex;
  gap: 8px;
}
.poster-card-linha .bolinha{
  width:6px; height:6px; border-radius:50%; margin-top:6px; flex-shrink:0;
}

.poster-warning{
  border: 1.5px solid var(--amber);
  background: rgba(240,193,75,0.10);
  border-radius: 10px;
  padding: 14px;
  color: var(--amber);
  font-weight: 700;
  font-size: 12.5px;
  display:flex;
  gap: 10px;
}

.poster-footer-text{
  text-align:center;
  font-weight: 800;
  font-size: 14px;
  white-space: pre-line;
}

.poster-divider{
  border:none;
  border-top: 1px solid rgba(255,255,255,0.24);
  margin: 20px 0 14px;
}
