@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300..900;1,300..900&display=swap');

:root {
  --primary-blue: #004b9b;
  --primary-blue-dark: #003875;
  --yellow: #ffd900;
  --green: #2ab456;
  --green-hover: #249e4b;
  --canvas-bg: #f3f4f7;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--primary-blue);
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #ffffff;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--primary-blue);
  background-image: url('bg-campanha.png');
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
}

.campaign-shell {
  min-height: 100vh;
  position: relative;
  padding: 24px 16px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.campaign-page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.campaign-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
}

.header-campaign-logo {
  width: 260px;
  max-width: 82vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

/* Intro Text */
.intro {
  text-align: center;
  margin-bottom: 20px;
  padding: 0 4px;
}

.intro h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(26px, 6.8vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 30, 80, 0.5);
}

.intro p {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(13px, 3.6vw, 14.5px);
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 auto;
  max-width: 420px;
  text-shadow: 0 1px 6px rgba(0, 30, 80, 0.4);
}

/* Editor Card */
.editor-card {
  width: 100%;
  position: relative;
  color: var(--text-dark);
  background: var(--card-bg);
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 20, 60, 0.35);
  overflow: hidden;
}

/* Canvas Preview */
.art-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 18px;
  background-color: var(--canvas-bg);
  touch-action: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  user-select: none;
  -webkit-user-select: none;
}

.art-canvas.is-draggable {
  cursor: grab;
}

.art-canvas.is-dragging {
  cursor: grabbing;
}

/* Upload State */
.upload-box {
  margin-top: 14px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  padding: 12px;
  transition: all 0.2s ease;
}

.upload-box:hover {
  border-color: var(--primary-blue);
  background: #f0f7ff;
}

.upload-box.is-drop-active {
  border-color: var(--green);
  background: #f0fdf4;
  transform: scale(1.01);
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: var(--primary-blue);
}

.upload-box span:last-of-type {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.upload-box strong {
  display: block;
  color: var(--primary-blue);
  font-size: 15px;
  font-weight: 700;
}

.initial-choose-btn {
  margin-top: 12px;
  background: var(--primary-blue);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  width: 100%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.initial-choose-btn:hover {
  background: var(--primary-blue-dark);
}

.initial-choose-btn:active {
  transform: scale(0.99);
}

/* Editing Controls State */
.editing-controls {
  margin-top: 14px;
}

.file-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: var(--primary-blue);
}

.status-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: #16a34a;
  font-size: 14px;
  font-weight: 900;
  flex: 0 0 auto;
}

.file-status > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.file-status strong {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.file-status small {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
}

.zoom-control input[type="range"] {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: #e2e8f0;
  outline: none;
  accent-color: var(--primary-blue);
  cursor: pointer;
}

.drag-hint {
  margin: 8px 0 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Action Stack */
.action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.save-gallery-btn {
  background: var(--primary-blue) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(0, 75, 155, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.save-gallery-btn:hover {
  background: var(--primary-blue-dark) !important;
  box-shadow: 0 6px 18px rgba(0, 75, 155, 0.45);
}

.save-gallery-btn:active {
  transform: scale(0.99);
}

.action-subrow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-button {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.secondary-button:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.secondary-button:active {
  transform: scale(0.99);
}

.hidden-input {
  display: none;
}

/* WhatsApp Share Button */
.share-row {
  margin-top: 12px;
}

.whatsapp-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 18px;
  background-color: var(--green);
  color: #ffffff !important;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(42, 180, 86, 0.35);
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.whatsapp-button:hover {
  background-color: var(--green-hover);
  box-shadow: 0 6px 18px rgba(42, 180, 86, 0.45);
  color: #ffffff !important;
}

.whatsapp-button:active {
  transform: scale(0.99);
}

.whatsapp-button svg {
  flex-shrink: 0;
}

/* Privacy Note */
.privacy-note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Footer */
footer {
  margin-top: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-family: 'Montserrat', sans-serif;
}

.footer-campaign {
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
}

.footer-legal {
  font-weight: 400;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 15, 40, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 2;
  background: #ffffff;
  color: var(--text-dark);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  color: #475569;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.modal-header {
  text-align: center;
  margin-bottom: 14px;
}

.modal-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 4px;
}

.modal-header h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.modal-preview-wrapper {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--canvas-bg);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.modal-result-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.modal-tip-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #1e40af;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* Version Selector */
.version-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 30, 80, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 18px;
  max-width: 100%;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 99px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.version-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.version-pill.active {
  background: #ffffff;
  color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .campaign-shell {
    padding: 16px 12px 32px;
  }
  .version-selector {
    width: 100%;
    gap: 4px;
    padding: 4px;
  }
  .version-pill {
    flex: 1;
    padding: 7px 8px;
    font-size: 11px;
    text-align: center;
  }
  .editor-card {
    border-radius: 22px;
    padding: 14px;
  }
  .intro h1 {
    font-size: 26px;
  }
  .intro p {
    font-size: 13px;
  }
}

