/* ─────────────────────────────────────────────────────────────────────────────
   Generador de Sesiones · style.css
   ───────────────────────────────────────────────────────────────────────────── */

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

:root {
  --rojo:    #C00000;
  --rojo-dk: #900000;
  --azul:    #2F5496;
  --azul-lt: #BDD7EE;
  --verde:   #375623;
  --verde-lt:#E2EFDA;
  --amarillo:#FFD966;
  --gris-lt: #F7F7F7;
  --gris-md: #E8E8E8;
  --gris-brd:#D0D0D0;
  --text:    #1A1A1A;
  --text-sm: #555;
  --radius:  12px;
  --shadow:  0 2px 12px rgba(0,0,0,.10);
  --shadow-hover: 0 4px 20px rgba(0,0,0,.16);
  --transition: .2s ease;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: #F0F4F8;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  background: linear-gradient(135deg, var(--rojo) 0%, var(--rojo-dk) 100%);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon { font-size: 2rem; }
.header-logo h1 { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.header-logo p  { font-size: .8rem; opacity: .85; }
.header-badge {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Main container ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  flex: 1;
}

/* ── Welcome card ── */
.welcome-card {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 1px solid #93C5FD;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  font-size: .9rem;
  color: #1E40AF;
  position: relative;
}
.welcome-icon { font-size: 1.5rem; flex-shrink: 0; }
.btn-close-welcome {
  background: none; border: none; cursor: pointer;
  color: #93C5FD; font-size: 1rem; padding: 0;
  position: absolute; top: 10px; right: 12px;
}
.btn-close-welcome:hover { color: #1E40AF; }

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--gris-md);
  transition: box-shadow var(--transition);
}
.card:focus-within { box-shadow: var(--shadow-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: background var(--transition);
}
.card-header:hover { background: var(--gris-lt); }

.card-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.card-num {
  width: 32px; height: 32px;
  background: var(--rojo);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}
.card-header h2  { font-size: 1rem; font-weight: 600; color: var(--text); }
.card-header p   { font-size: .78rem; color: var(--text-sm); margin-top: 2px; }
.card-arrow      { color: var(--gris-brd); font-size: .85rem; transition: transform var(--transition); }
.card-arrow.open { transform: rotate(180deg); }

.card-body {
  padding: 20px;
  border-top: 1px solid var(--gris-md);
  display: block;
}
.card-body.collapsed { display: none; }

/* ── Fields ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-full { grid-column: 1 / -1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.label-hint {
  font-weight: 400;
  color: var(--text-sm);
  font-size: .75rem;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gris-brd);
  border-radius: 8px;
  font-size: .88rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px rgba(192,0,0,.12);
}
input.invalid,
textarea.invalid {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
textarea { resize: vertical; min-height: 72px; }

.save-hint {
  margin-top: 14px;
  font-size: .78rem;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Checkboxes ── */
.opciones-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1.5px solid var(--gris-md);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.check-item:hover { border-color: var(--rojo); background: #FFF5F5; }
.check-item input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--rojo); flex-shrink: 0;
}
.check-item strong { font-size: .88rem; display: block; margin-bottom: 2px; }
.check-item small  { font-size: .78rem; color: var(--text-sm); }

/* ── Generate button section ── */
.generate-section {
  text-align: center;
  padding: 8px 0 0;
}
.btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--rojo) 0%, var(--rojo-dk) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 16px 48px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(192,0,0,.4);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  min-width: 280px;
}
.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(192,0,0,.5);
}
.btn-generate:active:not(:disabled) { transform: translateY(0); }
.btn-generate:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}
.generate-hint {
  margin-top: 10px;
  font-size: .82rem;
  color: var(--text-sm);
}

/* ── Loader dots ── */
.loader-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: .6; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ── Status bars ── */
.status-bar, .error-bar, .success-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-top: 16px;
  font-size: .9rem;
  font-weight: 500;
}
.status-bar   { background: #EFF6FF; border: 1px solid #93C5FD; color: #1D4ED8; }
.error-bar    { background: #FEF2F2; border: 1px solid #FCA5A5; color: #B91C1C; }
.success-bar  { background: #F0FDF4; border: 1px solid #86EFAC; color: #166534; }

.status-bar   button,
.error-bar    button,
.success-bar  button {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; padding: 0 4px;
  color: inherit; opacity: .7; margin-left: auto;
}
.status-bar button:hover,
.error-bar  button:hover,
.success-bar button:hover { opacity: 1; }

.status-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid #93C5FD;
  border-top-color: #1D4ED8;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status messages cycling ── */
#statusMsg { flex: 1; }

/* ── Footer ── */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--gris-md);
  text-align: center;
  padding: 14px;
  font-size: .78rem;
  color: var(--text-sm);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .field-full { grid-column: 1; }
  .header-logo h1 { font-size: 1rem; }
  .btn-generate { padding: 14px 28px; font-size: .95rem; min-width: 240px; }
}
