/* =====================================================
   🎨 ESTILOS DEL FORMULARIO
   Archivo: css/style.css
   ===================================================== */

:root {
  --fire: #ff4d00;
  --gold: #ffd700;
  --ember: #ff8c00;
  --dark: #050305;
  --darkCard: rgba(15, 5, 10, 0.95);
  --text: #e8d5b0;
  --muted: #907060;
  --border: rgba(255, 140, 0, 0.18);
  --error: #ef4444;
  --success: #4ade80;
  --warning: #f59e0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--dark);
  color: var(--text);
  font-family: 'Cinzel', serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==================== FONDO ANIMADO ==================== */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ==================== NAVBAR ==================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 3, 5, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.top-logo {
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.9rem;
  background: linear-gradient(90deg, #ff8c00, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
  letter-spacing: 0.1em;
}

.top-socials {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.top-socials a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 140, 0, 0.1);
  border-radius: 2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.top-socials a:hover {
  color: var(--gold);
  border-color: var(--ember);
  background: rgba(255, 77, 0, 0.05);
}

/* ==================== HEADER ==================== */
.header {
  position: relative;
  z-index: 1;
  background: radial-gradient(ellipse 80% 50% at 50% 100%, rgba(180, 40, 0, 0.2) 0%, transparent 70%);
  border-bottom: 2px solid var(--fire);
  padding: 8rem 2rem 3rem;
  text-align: center;
  margin-bottom: 2rem;
}

.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--ember);
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: fadeDown 0.8s ease both;
}

.header h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  background: linear-gradient(150deg, #ffe680 0%, #ff8c00 40%, #ff2200 70%, #cc00ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 25px rgba(255, 100, 0, 0.45));
  margin-bottom: 0.5rem;
  animation: blazeIn 1s ease both;
}

.header p {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--muted);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

@keyframes blazeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== REQUISITOS ==================== */
.requisitos {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}

.req-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1.3rem;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.req-item {
  background: linear-gradient(135deg, rgba(25, 8, 5, 0.9), rgba(12, 3, 18, 0.9));
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.req-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 150, 0, 0.5));
}

.req-text h4 {
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.req-text p {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ==================== CONTAINER ==================== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  position: relative;
  z-index: 1;
}

/* ==================== FORMULARIO ==================== */
.petition-form {
  background: linear-gradient(145deg, rgba(20, 8, 5, 0.95), rgba(10, 3, 15, 0.95));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

fieldset {
  border: none;
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
  border-top: 1px solid rgba(255, 77, 0, 0.2);
}

fieldset:first-of-type {
  border-top: none;
  padding-top: 0;
}

legend {
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 1.2rem;
  font-weight: bold;
  font-family: 'Cinzel Decorative', serif;
  letter-spacing: 0.05em;
}

/* ==================== FORM GROUPS ==================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 77, 0, 0.2);
  color: var(--text);
  font-family: 'Cinzel', serif;
  border-radius: 4px;
  transition: all 0.25s ease;
  font-size: 0.95rem;
  line-height: 1.5;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--fire);
  background: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 12px rgba(255, 77, 0, 0.3), inset 0 0 8px rgba(255, 77, 0, 0.1);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23907060' d='M0 0l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.5rem;
}

/* ==================== ROWS ==================== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==================== ABILITY GROUPS ==================== */
.ability-group {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 140, 0, 0.1);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.ability-group h3 {
  font-size: 0.9rem;
  color: var(--ember);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

/* ==================== CANVAS ==================== */
.canvas-tools {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 77, 0, 0.1);
  border-radius: 4px;
  align-items: center;
}

.tool-btn {
  padding: 0.6rem 1rem;
  background: rgba(255, 77, 0, 0.08);
  border: 1px solid var(--fire);
  color: var(--text);
  cursor: pointer;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  transition: all 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.tool-btn:hover {
  background: rgba(255, 77, 0, 0.15);
  transform: translateY(-2px);
}

.tool-btn.active {
  background: var(--fire);
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 77, 0, 0.4);
}

.color-picker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.color-picker label {
  margin: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}

.color-picker input[type="color"] {
  width: 40px;
  height: 40px;
  border: 2px solid var(--fire);
  border-radius: 4px;
  cursor: pointer;
  padding: 2px;
}

/* Fila de sliders (tamaño/opacidad) y fila de paleta de colores */
.canvas-tools-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.canvas-tools-row label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.brush-range {
  width: 90px;
  accent-color: var(--fire);
  cursor: pointer;
}

.brush-value {
  font-size: 0.75rem;
  color: var(--gold);
  width: 32px;
  text-align: left;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--gold);
}

#colorInput {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  padding: 0;
  margin-left: 0.3rem;
}

.canvas-hint {
  text-align: center;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 80, 0, 0.08);
  border-top: none;
  max-width: 600px;
  margin: -1rem auto 1.5rem;
}

.sketch-canvas {
  border: 2px solid var(--fire);
  background: #000;
  width: 100%;
  max-width: 600px;
  height: 400px;
  display: block;
  cursor: crosshair;
  margin: 1.5rem auto;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(255, 77, 0, 0.2);
}

/* ==================== BOTONES ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--fire), #ff6b00);
  color: #000;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(255, 77, 0, 0.3);
  display: inline-block;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 77, 0, 0.5);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.8rem 1.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 215, 0, 0.1);
  transform: translateY(-2px);
}

/* ==================== MENSAJES ==================== */
.error-message {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--error);
  border-radius: 2px;
}

.input-error {
  border-color: var(--error) !important;
}

.form-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
  font-style: italic;
}

/* ==================== MODAL DE ÉXITO ==================== */
.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 3, 5, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.success-modal.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.success-content {
  background: linear-gradient(145deg, rgba(20, 8, 5, 0.99), rgba(10, 3, 15, 0.99));
  border: 2px solid var(--gold);
  padding: 2.5rem;
  text-align: center;
  border-radius: 8px;
  max-width: 500px;
  animation: slideUp 0.4s ease;
}

.success-content h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px rgba(255, 200, 0, 0.3));
}

.success-content p {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.success-content .small {
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== GALERÍA LINK ==================== */
.gallery-link {
  text-align: center;
  padding: 2rem 0;
}

.gallery-link .btn-secondary {
  font-size: 1rem;
  padding: 1rem 2rem;
}

/* ==================== DONACIONES ==================== */
.donation-section {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
}

.donation-box-new {
  background: linear-gradient(135deg, rgba(80, 0, 0, 0.25), rgba(40, 0, 60, 0.25));
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 4px;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.donation-box-new::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 100, 0, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.donation-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.donation-sub {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
}

.donation-btns {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.btn-paypal-new,
.btn-kofi-new {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.25s;
}

.btn-paypal-new {
  background: #003087;
  color: #fff;
}

.btn-paypal-new:hover {
  background: #0047b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 48, 135, 0.4);
}

.btn-kofi-new {
  background: rgba(255, 140, 0, 0.1);
  color: var(--gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.btn-kofi-new:hover {
  background: rgba(255, 140, 0, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.2);
}

.donation-bank {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.donation-bank span {
  color: var(--ember);
}

/* ==================== FOOTER ==================== */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

footer .footer-links {
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
}

footer .footer-links a {
  margin: 0 0.3rem;
}

footer a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--ember);
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem 2rem;
  }

  .petition-form {
    padding: 1.5rem;
  }

  .header {
    padding: 7rem 1rem 2rem;
    margin-bottom: 1.5rem;
  }

  .top-bar {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .top-socials {
    width: 100%;
    justify-content: center;
  }

  fieldset {
    padding: 1rem 0;
  }

  legend {
    font-size: 1.1rem;
  }

  .canvas-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  .color-picker {
    margin-left: 0;
    width: 100%;
  }

  .req-grid {
    grid-template-columns: 1fr;
  }

  .btn-primary {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }

  .petition-form {
    padding: 1rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* Evitar zoom en móvil */
  }

  .sketch-canvas {
    max-width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 0.9rem;
    padding: 0.8rem 1.5rem;
  }
}
/* ==================== CONTADOR DE CARACTERES ==================== */
.char-counter {
  display: block;
  text-align: right;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  user-select: none;
}

.char-counter--warn {
  color: var(--warning);
}

.char-counter--over {
  color: var(--error);
  font-weight: bold;
}

/* ==================== NOTIFICACIÓN DE BORRADOR ==================== */
.draft-notification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-left: 3px solid var(--success);
  padding: 0.8rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--success);
  animation: slideDown 0.3s ease;
}

.draft-notification__close {
  background: none;
  border: none;
  color: var(--success);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.7;
  padding: 0 0.3rem;
  transition: opacity 0.2s;
  line-height: 1;
}

.draft-notification__close:hover { opacity: 1; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}