/* ================================================
   Caja de Cartas Virtual — Estilos globales
   Paleta rosa pastel
   ================================================ */

:root {
  --fondo: #fff0f3;
  --primario: #f4a7b9;
  --hover: #e87fa0;
  --texto: #5c2d3e;
  --texto-sec: #a06070;
  --sobre-rosa: #f8c8d4;
  --sobre-lila: #d8c8f0;
  --sobre-menta: #c8f0e0;
  --sobre-celeste: #c8e8f8;
  --sobre-amarillo: #f8f0c0;
  --sobre-melocoton: #f8d8c0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Georgia', serif;
  background-color: var(--fondo);
  color: var(--texto);
  min-height: 100vh;
}

h1, h2, h3 {
  color: var(--texto);
  font-weight: normal;
}

/* ── Botones ── */
.btn {
  display: inline-block;
  background: var(--primario);
  color: var(--texto);
  border: none;
  border-radius: 25px;
  padding: 12px 28px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover {
  background: var(--hover);
  color: #fff;
}

/* ── Inputs ── */
input, textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--primario);
  border-radius: 12px;
  background: #fff;
  color: var(--texto);
  font-size: 1rem;
  margin-top: 6px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus {
  border-color: var(--hover);
}

/* ── Contenedor principal ── */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ── Header ── */
.header {
  text-align: center;
  padding: 24px 0 16px;
}
.header h1 {
  font-size: 2rem;
  color: var(--texto);
}
.header p {
  color: var(--texto-sec);
  margin-top: 6px;
}

/* ── Formulario escribir ── */
.form-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(244, 167, 185, 0.25);
  margin-top: 20px;
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: bold;
  color: var(--texto);
  margin-bottom: 4px;
}

/* ── Selector de colores de sobre ── */
.color-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.color-option {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.color-option:hover {
  transform: scale(1.1);
}
.color-option.selected {
  border-color: var(--hover);
  transform: scale(1.15);
}
.color-rosa     { background: var(--sobre-rosa); }
.color-lila     { background: var(--sobre-lila); }
.color-menta    { background: var(--sobre-menta); }
.color-celeste  { background: var(--sobre-celeste); }
.color-amarillo { background: var(--sobre-amarillo); }
.color-melocoton { background: var(--sobre-melocoton); }

/* ── Preview de foto ── */
.foto-preview {
  margin-top: 12px;
  max-width: 200px;
  border-radius: 12px;
  display: none;
}
.foto-preview.visible {
  display: block;
}

/* ── Confirmación ── */
.confirmacion {
  text-align: center;
  padding: 40px 20px;
  display: none;
}
.confirmacion.visible {
  display: block;
}
.confirmacion .emoji {
  font-size: 3rem;
}
.confirmacion h2 {
  font-size: 1.6rem;
  margin: 16px 0 8px;
}
.confirmacion p {
  color: var(--texto-sec);
}

/* ── Caja de sobres ── */
.sobres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.sobre {
  cursor: pointer;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(244, 167, 185, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeInScale 0.4s ease both;
}
.sobre:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 8px 24px rgba(244, 167, 185, 0.35);
}
.sobre .sobre-icono {
  font-size: 2.5rem;
}
.sobre .sobre-nombre {
  font-size: 0.85rem;
  color: var(--texto);
  margin-top: 8px;
  font-weight: bold;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Vista de sobre abierto ── */
.sobre-abierto {
  display: none;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 6px 30px rgba(244, 167, 185, 0.3);
  margin-top: 24px;
  animation: fadeInScale 0.3s ease;
}
.sobre-abierto.visible {
  display: block;
}
.sobre-abierto .mensaje-texto {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--texto);
  white-space: pre-wrap;
}
.sobre-abierto .foto-carta {
  margin-top: 20px;
  max-width: 100%;
  border-radius: 12px;
}
.sobre-abierto .btn-cerrar {
  margin-top: 24px;
}

/* ── Pantalla de acceso ── */
.acceso-screen {
  text-align: center;
  padding: 40px 20px;
}
.acceso-opciones {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 300px;
  margin: 32px auto 0;
}
.acceso-form {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 20px rgba(244, 167, 185, 0.25);
  max-width: 400px;
  margin: 24px auto 0;
  display: none;
}
.acceso-form.visible {
  display: block;
}

/* ── Panel organizadora ── */
.panel-organizadora table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}
.panel-organizadora th,
.panel-organizadora td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--primario);
  font-size: 0.9rem;
}
.panel-organizadora th {
  background: var(--primario);
  color: var(--texto);
}

/* ── Media queries responsive ── */
@media (max-width: 480px) {
  .header h1 { font-size: 1.5rem; }
  .form-card { padding: 20px; }
  .sobres-grid { grid-template-columns: repeat(2, 1fr); }
  .color-option { width: 40px; height: 40px; }
  .acceso-opciones { max-width: 100%; }
}

@media (max-width: 360px) {
  .container { padding: 20px 12px; }
  .btn { padding: 10px 20px; font-size: 0.9rem; }
}
