:root {
  --orange: #EC671C;
  --orange-hover: #d5560e;
  --navy: #1A2644;
  --navy-light: #25355c;
  --bg: #F6F7F9;
  --white: #ffffff;
  --muted: #687386;
  --line: #E2E5EA;
  --radius: 12px;
}

*, *:before, *:after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--navy);
  background: var(--bg);
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

button, input {
  font: inherit;
}

button {
  touch-action: manipulation;
  cursor: pointer;
}

/* ================= TOPBAR / MENU ================= */
.topbar {
  width: 100%;
  height: 64px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.topbar-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.menu-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ================= CONTAINER PRINCIPAL ================= */
.main-container {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 24px 16px;
}

.hidden {
  display: none !important;
}

/* ================= TELA DE BOAS-VINDAS ================= */
.welcome-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.badge {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--orange);
  background: rgba(236, 103, 28, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

/* ================= BANNER CARD (1:1) ================= */
.banner-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  width: 100%;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-card h2 {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 1080px;
  aspect-ratio: 1 / 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.banner-card h2 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.welcome-section h1 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0 0 20px 0;
  color: var(--navy);
}

/* ================= TUTORIAL CARD ================= */
.tutorial-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  text-align: left;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.tutorial-card h2 {
  font-size: 16px;
  margin: 0 0 16px 0;
  color: var(--navy);
}

.tutorial-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tutorial-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  background: var(--navy);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.step-text strong {
  color: var(--navy);
}

/* ================= EDITOR DE FOTO ================= */
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.editor-header h2 {
  margin: 0;
  font-size: 20px;
}

.btn-help {
  background: rgba(236, 103, 28, 0.08);
  border: 1px solid rgba(236, 103, 28, 0.2);
  color: var(--orange);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.btn-help:hover {
  background: rgba(236, 103, 28, 0.15);
}

.editor-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.editor-hint svg {
  flex-shrink: 0;
  color: var(--orange);
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #e9ecef;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  touch-action: none;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ================= CONTROLES & BOTÕES ================= */
.controls {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
}

.zoom-control input[type="range"] {
  flex: 1;
  accent-color: var(--orange);
  height: 28px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions .btn {
  flex: 1 1 140px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
  min-height: 48px;
}

.btn-lg {
  padding: 16px 28px;
  font-size: 16px;
  width: 100%;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-primary:hover, .btn-primary:active {
  background: var(--orange-hover);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-secondary:hover, .btn-secondary:active {
  background: #f0f2f5;
}

/* ================= MODAL DE AJUDA ================= */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 38, 68, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-content {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  max-width: 440px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--navy);
}

.modal-close-icon {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  line-height: 1;
  padding: 0;
}

.help-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--bg);
  padding: 12px;
  border-radius: 8px;
}

.help-list li strong {
  display: block;
  color: var(--navy);
  margin-bottom: 4px;
}

/* ================= RESPONSIVIDADE MOBILE ================= */
@media (max-width: 480px) {
  .main-container {
    padding: 16px 12px;
  }

  .banner-card {
    padding: 8px;
    margin-bottom: 16px;
  }

  .tutorial-card {
    padding: 14px;
  }

  .modal-content {
    padding: 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
}