/* ==========================================================================
   UNIMEDIC IPS - AUTHENTIC COLOR SCHEME & RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

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

:root {
  /* Unimedic Official Colors: Vinotinto / Magenta + Deep Corporate Blue */
  --primary: #d91b5c;
  --primary-dark: #b8144b;
  --primary-deep: #8e0e38;
  --primary-light: #fdf2f8;
  --primary-glow: rgba(217, 27, 92, 0.25);

  --secondary: #1e3b70;
  --secondary-dark: #122448;
  --secondary-light: #f0f5ff;

  --accent: #e11d48;
  --accent-gold: #f59e0b;

  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;

  --bg: #f4f7fb;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #edf2f9 100%);
  --nav-gradient: linear-gradient(90deg, #122448 0%, #1e3b70 40%, #b8144b 80%, #d91b5c 100%);

  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-glass: rgba(255, 255, 255, 0.96);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;

  --border: #e2e8f0;
  --border-focus: #d91b5c;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 15px -2px rgba(18, 36, 72, 0.08);
  --shadow-lg: 0 15px 30px -5px rgba(18, 36, 72, 0.12);
  --shadow-xl: 0 25px 40px -10px rgba(142, 14, 56, 0.12);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(217, 27, 92, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(30, 59, 112, 0.04) 0%, transparent 40%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--secondary-dark);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

/* Large, Responsive Desktop Layout */
.container {
  width: 95%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1rem;
}

.main-content {
  flex: 1;
  padding: 2.5rem 0 4rem;
}

/* Unimedic Signature Gradient Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-gradient);
  box-shadow: 0 4px 25px rgba(18, 36, 72, 0.2);
  color: white;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

/* Authentic Unimedic Logo image container */
.nav-logo {
  height: 48px;
  width: auto;
  background: transparent;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  transition: var(--transition);
}

.nav-logo:hover {
  transform: scale(1.03);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-deep) 100%);
  box-shadow: 0 8px 24px rgba(217, 27, 92, 0.4);
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--secondary-dark);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--secondary);
  color: var(--secondary);
  transform: translateY(-2px);
}

.btn-nav-white {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-nav-white:hover {
  background: #ffffff;
  color: var(--secondary-dark);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(30, 59, 112, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  color: #ffffff;
}

.btn-sm {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.95rem 2.2rem;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

/* Spacious, Well-Structured Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--secondary-dark);
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
  font-weight: 400;
}

/* Two-column layout for PC / Wide Screens */
.citas-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 2.5rem;
  align-items: start;
}

.split-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-dark);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.85rem 1.15rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--text-main);
  transition: var(--transition);
  font-weight: 500;
  box-sizing: border-box;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

textarea.form-control, textarea.form-textarea, .form-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

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

/* Hero Section */
.hero-section {
  position: relative;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #122448 0%, #1e3b70 60%, #8e0e38 100%);
  color: #ffffff;
  padding: 4rem 3.5rem;
  margin-bottom: 3rem;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-title {
  color: #ffffff;
  font-size: 3.2rem;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-title span {
  color: #f472b6;
  background: linear-gradient(135deg, #f472b6 0%, #fb7185 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: #e2e8f0;
  font-size: 1.2rem;
  margin-bottom: 2.25rem;
  line-height: 1.6;
  max-width: 600px;
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.service-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  opacity: 0;
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
}

.service-card:hover::after {
  opacity: 1;
}

.service-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.service-title {
  font-size: 1.4rem;
  color: var(--secondary-dark);
  margin-bottom: 0.6rem;
}

.service-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  flex: 1;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: var(--success-light);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.data-table th {
  background: #f8fafc;
  color: var(--secondary-dark);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fdf2f8;
}

/* Footer */
.footer {
  background: var(--secondary-dark);
  color: #cbd5e1;
  padding: 3.5rem 0 2rem;
  border-top: 1px solid #1e3b70;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 3rem;
  margin-bottom: 2rem;
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 320px;
  max-width: 460px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1rem 1.35rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: toastSlide 0.3s ease forwards;
}

.toast.toast-success { border-color: #86efac; background: #f0fdf4; color: #166534; }
.toast.toast-error { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.toast.toast-warning { border-color: #fde047; background: #fefce8; color: #854d0e; }

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE MEDIA QUERIES FOR SMALL & MOBILE SCREENS */
@media (max-width: 1024px) {
  .citas-layout, .split-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2.5rem 1.5rem;
    flex-direction: column;
    text-align: center;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-desc {
    font-size: 1rem;
  }
  .card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
  }
  .nav-container {
    height: auto;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
  }
  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
  }
  .nav-actions {
    margin-left: auto;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.85rem;
  }
  .btn {
    width: 100%;
    padding: 0.75rem 1.2rem;
  }
  .card-title {
    font-size: 1.35rem;
  }
}


/* ===== ELEGANT & SPACIOUS UNIMEDIC FOOTER ===== */
.footer {
  background: var(--secondary-dark, #122448);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
  margin-top: 5rem;
  border-top: 3px solid rgba(217, 27, 92, 0.3);
}

.footer-bg-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(217, 27, 92, 0.15) 0%, transparent 70%);
  transform: translate(30%, -30%);
  pointer-events: none;
}

.footer-container {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.05fr 1.65fr;
  gap: 4.5rem;
  position: relative;
  z-index: 2;
  align-items: center;
}

.footer-brand .footer-logo {
  height: 60px;
  width: auto;
  margin-bottom: 1.25rem;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.footer-desc {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.7;
  font-size: 1.05rem;
  max-width: 440px;
  margin-bottom: 1.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2.5rem 3rem;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.footer-col h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-col h3 svg {
  color: var(--primary, #d91b5c);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-col ul li strong {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.05rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  transition: var(--transition);
  margin-top: 0.5rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
  background: var(--primary, #d91b5c);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.footer-bottom {
  margin-top: 4.5rem;
  padding: 1.75rem 5%;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    padding: 1.75rem;
    gap: 1.75rem;
  }
}


/* ===== RESPONSIVE NAVBAR & MOBILE HAMBURGER ===== */
.nav-toggle {
  display: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .nav-container {
    height: 72px;
    padding: 0;
  }
  .nav-logo {
    height: 40px;
  }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 9px 8px;
    z-index: 110;
  }
  .nav-toggle span {
    width: 100%;
    height: 2.5px;
    background: #ffffff;
    border-radius: 2px;
    transition: var(--transition);
  }
  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #122448 0%, #1e3b70 100%);
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    padding: 1.5rem 1.75rem 2rem;
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 105;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .nav-menu.active {
    display: flex;
    animation: mobileMenuSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes mobileMenuSlide {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    padding: 0;
  }
  .nav-link {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
    display: block;
    background: rgba(255, 255, 255, 0.06);
  }
  .nav-link:hover, .nav-link.active {
    background: var(--primary);
    color: #ffffff;
  }
  .nav-actions {
    width: 100%;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-left: 0;
    gap: 0.75rem;
  }
  .nav-actions .btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
  }
}

/* Small screen tweaks for wizard stepper */
@media (max-width: 600px) {
  .wizard-steps::before {
    top: 18px;
  }
  .step-number {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
  .step-label {
    font-size: 0.75rem;
    text-align: center;
  }
  .card {
    padding: 1.5rem 1rem;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)) !important;
  }
}
