@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --primary: #0f2d59; /* CIFOG Dark Blue */
  --primary-hover: #1e3d6f;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  
  /* Status Colors */
  --status-admes: #10b981; /* Emerald Green */
  --status-admes-bg: #ecfdf5;
  --status-admes-text: #065f46;
  
  --status-reserva: #f59e0b; /* Amber Gold */
  --status-reserva-bg: #fffbeb;
  --status-reserva-text: #92400e;
  
  --status-exclos: #ef4444; /* Rose Red */
  --status-exclos-bg: #fef2f2;
  --status-exclos-text: #991b1b;
  
  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Outfit', sans-serif;
  
  /* Transitions */
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout Container */
#container {
  max-width: 900px;
  width: 100%;
  margin: 40px auto;
  padding: 24px;
}

/* Header & Logo */
.logo-container {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-container img {
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

/* Headings */
h1 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary);
  font-size: 2.2rem;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
  text-align: center;
}

h2 {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--primary);
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--primary);
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Typography and helper utilities */
p {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.text-center {
  text-align: center;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 2rem 0;
}

/* Cards (Standard & Glassmorphism) */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  margin-bottom: 2rem;
  transition: var(--transition-normal);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -6px rgba(15, 23, 42, 0.08);
}

/* State Specific Cards */
.card-admes {
  border-top: 6px solid var(--status-admes);
}
.card-reserva {
  border-top: 6px solid var(--status-reserva);
}
.card-exclos {
  border-top: 6px solid var(--status-exclos);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  letter-spacing: 0.025em;
  margin-bottom: 1.5rem;
}

.badge-admes {
  background-color: var(--status-admes-bg);
  color: var(--status-admes-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-reserva {
  background-color: var(--status-reserva-bg);
  color: var(--status-reserva-text);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-exclos {
  background-color: var(--status-exclos-bg);
  color: var(--status-exclos-text);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alumn {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary);
}

.input-dni {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1.2rem;
  font-family: var(--font-sans);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  transition: var(--transition-fast);
  color: var(--text-dark);
}

.input-dni:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.info {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.error {
  color: var(--status-exclos);
  font-size: 0.875rem;
  font-weight: 500;
  display: block;
  margin-top: 0.25rem;
}

/* Buttons */
input[type="submit"], button, .btn {
  background-color: var(--primary);
  color: #ffffff;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  width: 100%;
}

input[type="submit"]:hover, button:hover, .btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

input[type="submit"]:active, button:active, .btn:active {
  transform: translateY(0);
}

/* Details Grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-item {
  background-color: var(--bg-app);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}

.detail-item.success {
  border-left-color: var(--status-admes);
}

.detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.detail-val {
  font-weight: 600;
  color: var(--primary);
  font-size: 1.05rem;
}

/* Checklist items */
ul {
  list-style: none;
  margin: 1rem 0;
}

li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
}

li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--status-admes);
  font-weight: bold;
}

/* Special Text Styles */
#financial_info {
  background-color: var(--accent-light);
  border: 1px dashed rgba(37, 99, 235, 0.25);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

#financial_info p {
  margin-bottom: 0.5rem;
}

#financial_info span {
  font-weight: 600;
  color: var(--accent);
}

.price-card {
  border: 1px solid var(--border-color);
  background-color: var(--bg-app);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.price-card h3 {
  margin-top: 0;
  color: var(--primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Confirmation Warning Alert */
#confirmation {
  background-color: var(--status-reserva-bg);
  border-left: 4px solid var(--status-reserva);
  color: var(--status-reserva-text);
  border-radius: 4px 8px 8px 4px;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 1.5rem 0;
}

/* Admin Styling */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.stat-num {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Admin Dashboard Table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-card);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background-color: var(--bg-app);
  border-bottom: 2px solid var(--border-color);
}

th {
  font-family: var(--font-title);
  font-weight: 600;
  padding: 1rem;
  color: var(--primary);
  font-size: 0.9rem;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

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

tr:hover td {
  background-color: var(--bg-app);
}

/* Small status pill badges inside tables */
.pill-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pill-admes {
  background-color: var(--status-admes-bg);
  color: var(--status-admes-text);
}

.pill-reserva {
  background-color: var(--status-reserva-bg);
  color: var(--status-reserva-text);
}

.pill-exclos {
  background-color: var(--status-exclos-bg);
  color: var(--status-exclos-text);
}

/* Admin Filter Controls */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex-grow: 1;
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
}

/* Footer Styling */
footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Upgraded Admin Controls */
.btn-secondary {
  background-color: #e2e8f0 !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
}
.btn-secondary:hover {
  background-color: #cbd5e1 !important;
}

.btn-danger {
  background-color: var(--status-exclos) !important;
  color: #ffffff !important;
}
.btn-danger:hover {
  background-color: #dc2626 !important;
}

.btn-success {
  background-color: var(--status-admes) !important;
  color: #ffffff !important;
}
.btn-success:hover {
  background-color: #059669 !important;
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.btn-inline {
  width: auto !important;
  display: inline-block !important;
}

select.input-dni {
  background-color: #ffffff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--status-admes-bg);
  color: var(--status-admes-text);
  border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
  background-color: var(--status-exclos-bg);
  color: var(--status-exclos-text);
  border-color: rgba(239, 68, 68, 0.2);
}

.csv-upload-section {
  background-color: var(--bg-app);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition-fast);
}

.csv-upload-section:hover {
  border-color: var(--accent);
}

.file-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-input-wrapper input[type="file"] {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #ffffff;
  width: 100%;
}

/* Modal popup overlay and card layout */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  position: relative;
  padding: 2.5rem;
  max-width: 550px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-fast);
}

.close-modal:hover {
  color: var(--text-dark);
}

@keyframes modalFadeIn {
  from {
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}