/* ============================================================
   moldura.css — Gerador de Moldura Jucélia Vargas 1361
   Identidade visual: vermelho PT, branco, tipografia Playfair/Barlow
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Barlow:ital,wght@0,400;0,500;0,600;1,400;1,600&family=Barlow+Condensed:wght@600;700;800&display=swap');

/* ── Tokens de cor — identidade Jucélia ── */
:root {
  --primary:       #CC0000;
  --primary-dark:  #A80000;
  --primary-light: #FF1A1A;
  --secondary:     #1a1a1a;
  --accent:        #FFD700;
  --bg:            #1a0000;
  --bg-card:       #2a0505;
  --surface:       #1f1f1f;
  --surface-light: #2d2d2d;
  --text:          #FFFFFF;
  --text-muted:    rgba(255,255,255,0.6);
  --border:        rgba(255,255,255,0.12);
  --radius-sm:     8px;
  --radius:        16px;
  --radius-lg:     24px;
  --shadow:        0 8px 32px rgba(0,0,0,.4);
  --shadow-lg:     0 24px 64px rgba(0,0,0,.5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Header ── */
.m-header {
  background: rgba(10,0,0,0.95);
  backdrop-filter: blur(12px);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(204,0,0,0.3);
  box-shadow: 0 2px 20px rgba(0,0,0,.4);
}

.m-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.m-header-brand img {
  height: 44px;
  width: 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--primary);
}

.m-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.m-header-title span {
  color: var(--accent);
  font-size: 0.78rem;
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
}

.m-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(204,0,0,0.15);
  border: 1px solid rgba(204,0,0,0.35);
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
}

.m-back-btn:hover {
  background: rgba(204,0,0,0.3);
  border-color: var(--primary);
}

/* ── Hero Banner ── */
.m-hero {
  background: linear-gradient(135deg, #0d0000 0%, #1a0000 40%, #2d0000 70%, #1a0000 100%);
  padding: 56px 24px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.m-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(204,0,0,.18) 0%, transparent 70%);
  pointer-events: none;
}

.m-hero::after {
  content: '';
  position: absolute;
  bottom: -40px; right: -40px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,215,0,.06) 0%, transparent 70%);
  pointer-events: none;
}

.m-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .12em;
  padding: 5px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(204,0,0,.4);
}

.m-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 16px;
}

.m-hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.m-hero p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

/* Imagem de instruções no hero */
.m-hero-instructions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  max-width: 740px;
  margin-left: auto;
  margin-right: auto;
}

.m-hero-instructions img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  border: 1px solid rgba(204,0,0,.25);
}

/* ── Passos (como funciona) ── */
.m-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: var(--bg-card);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.m-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.m-step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(204,0,0,.4);
}

.m-step-sep {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
}

/* ── Container principal ── */
.m-main {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 36px 20px;
}

/* ── Step Upload ── */
#step-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.upload-card {
  background: var(--bg-card);
  border: 2px dashed rgba(204,0,0,.35);
  border-radius: var(--radius-lg);
  padding: 52px 32px;
  text-align: center;
  width: 100%;
  max-width: 480px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.upload-card:hover,
.upload-card.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(204,0,0,.12);
  background: rgba(204,0,0,.06);
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.upload-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.upload-card p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

.upload-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .2s;
  padding: 12px 22px;
  font-size: .95rem;
  line-height: 1;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(204,0,0,.45);
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 6px 24px rgba(204,0,0,.55);
  transform: translateY(-1px);
}

.btn-yellow {
  background: var(--accent);
  color: #1a0000;
  box-shadow: 0 4px 16px rgba(255,215,0,.35);
  font-weight: 700;
}

.btn-yellow:hover {
  background: #e6c200;
  box-shadow: 0 6px 24px rgba(255,215,0,.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-color: rgba(204,0,0,.5);
}

.btn-icon {
  font-size: 1.2em;
}

/* ── Step Editor ── */
#step-editor { display: flex; flex-direction: column; gap: 24px; }
#step-editor.hidden, #step-upload.hidden { display: none; }

/* Área do Canvas */
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6), 0 0 0 1px rgba(204,0,0,.2);
  background: #111;
  aspect-ratio: 1;
  cursor: grab;
}

.canvas-wrapper:active { cursor: grabbing; }

#editor-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.canvas-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.7);
  color: rgba(255,255,255,.85);
  font-size: .75rem;
  padding: 6px 16px;
  border-radius: 100px;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.1);
  opacity: 1;
  transition: opacity .5s;
}

.canvas-hint.fade-out { opacity: 0; }

/* ── Controles ── */
.controls-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.control-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  min-width: 52px;
}

/* Slider de Zoom */
.zoom-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-icon {
  font-size: 1rem;
  color: var(--text-muted);
  user-select: none;
}

input[type='range'] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.12);
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(204,0,0,.5);
  cursor: grab;
  transition: transform .15s;
}

input[type='range']::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
}

/* Botões de ação no editor */
.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Seção Download ── */
.download-section {
  background: linear-gradient(135deg, rgba(204,0,0,.12), rgba(180,0,0,.06));
  border: 1px solid rgba(204,0,0,.25);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.download-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.download-section p {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.download-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
}

.btn-download:active { transform: scale(.97); }

.btn-dl-png {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 18px rgba(204,0,0,.45);
}

.btn-dl-png:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(204,0,0,.55);
}

.btn-dl-jpg {
  background: var(--accent);
  color: #1a0000;
  box-shadow: 0 4px 18px rgba(255,215,0,.35);
}

.btn-dl-jpg:hover {
  background: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,215,0,.4);
}

/* ── Dicas de compartilhamento ── */
.share-tips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.share-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Footer ── */
.m-footer {
  background: #0d0000;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .82rem;
  border-top: 1px solid rgba(204,0,0,.15);
}

.m-footer strong { color: var(--accent); }
.m-footer a { color: rgba(255,255,255,.5); text-decoration: underline; }

/* ── Utilidades ── */
.hidden { display: none !important; }

/* ── Modal Webcam ── */
.webcam-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn .2s ease;
}

.webcam-modal.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.webcam-inner {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(480px, 95vw);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(204,0,0,.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.webcam-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.webcam-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.webcam-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.webcam-close:hover { background: rgba(204,0,0,.3); color: #fff; }

.webcam-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

#webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

/* Anel guia circular */
.webcam-overlay-ring {
  position: absolute;
  inset: 8%;
  border: 3px solid rgba(204,0,0,.9);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.4);
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { border-color: rgba(204,0,0,.9); }
  50%       { border-color: rgba(255,215,0,.6); }
}

.webcam-tip {
  text-align: center;
  font-size: .83rem;
  color: var(--text-muted);
}

.webcam-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-capture {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ── Placeholder aviso ── */
.placeholder-notice {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .82rem;
  color: rgba(255, 215, 0, 0.8);
  text-align: center;
  margin-top: -12px;
}

/* ── Responsivo ── */
@media (max-width: 600px) {
  .m-hero { padding: 40px 16px 32px; }
  .m-steps { gap: 8px; padding: 18px 16px; font-size: .8rem; }
  .m-step-sep { width: 20px; }
  .m-main { padding: 24px 16px; }
  .upload-card { padding: 36px 20px; }
  .controls-panel { padding: 18px; }
  .editor-actions { grid-template-columns: 1fr; }
  .download-btns { flex-direction: column; }
  .btn-download { width: 100%; justify-content: center; }
  .m-header-title { font-size: .9rem; }
}
