/* ============================
   Saco Mi Turno – Design System
   ============================ */

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --primary-50: #f0fdfa;
  --accent: #6366f1;
  --accent-light: #e0e7ff;
  --bg: #f8fafb;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning-bg: #fffbeb;
  --warning-text: #b45309;
  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Base ---- */
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

a {
  transition: color var(--transition), background var(--transition);
}

/* ---- Cards ---- */
.card-modern {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card-modern:hover {
  box-shadow: var(--shadow-md);
}

.card-modern + .card-modern {
  margin-top: 16px;
}

/* ---- Grid ---- */
.grid-auto {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (max-width: 640px) {
  .grid-auto {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---- Chips / Badges ---- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--border-light);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.chip.primary {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: transparent;
}

.chip.tag {
  background: var(--accent-light);
  color: var(--accent);
  border-color: transparent;
}

.badge-soft {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--success-bg);
  color: var(--success-text);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---- Lists ---- */
.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

.muted {
  color: var(--muted);
}

/* ---- Slots grid (agenda) ---- */
.slots-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.slot-btn {
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.slot-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
}

.slot-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.slot-btn:active {
  transform: translateY(0);
}

/* ---- Pill / Section ---- */
.pill-section {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

.label-inline {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--border-light);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* ---- Buttons (refine from base) ---- */
.btn {
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ---- Smooth table ---- */
table {
  font-size: 0.92rem;
}

th {
  background: var(--border-light);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 12px;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--primary-50);
}

/* ---- Form inputs (refine) ---- */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
  color: var(--muted);
}

/* ---- Hero area ---- */
.hero {
  background: linear-gradient(135deg, var(--primary-50) 0%, #e0f2fe 100%);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.hero h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ---- Messages ---- */
.message.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 500;
}

.message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 500;
}

/* ---- Scrollbar (webkit) ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ---- Focus ring for accessibility ---- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-modern,
.hero,
.how-step {
  animation: fadeInUp 0.4s ease both;
}

.grid-auto > .card-modern:nth-child(2) { animation-delay: 0.06s; }
.grid-auto > .card-modern:nth-child(3) { animation-delay: 0.12s; }
.grid-auto > .card-modern:nth-child(4) { animation-delay: 0.18s; }
.grid-auto > .card-modern:nth-child(5) { animation-delay: 0.24s; }
.grid-auto > .card-modern:nth-child(6) { animation-delay: 0.30s; }

/* ---- Selection color ---- */
::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}

