/* ============================================
   REDES - Espacio de Salud Mental
   Design System & Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
    --aqua: #36B2AE;
    --aqua-dark: #2a908d;
    --aqua-light: #54ccc8;
    --aqua-glow: rgba(54, 178, 174, 0.15);
    --beige: #DEC798;
    --beige-dark: #c8ad78;
    --beige-light: #ecdbb8;
    --bg: #F4EFE0;
    --bg-alt: #ebe4d1;
    --white: #ffffff;
    --text-dark: #2c3e3e;
    --text-medium: #5a6b6b;
    --text-light: #8a9a9a;
    --shadow-sm: 0 2px 8px rgba(44, 62, 62, 0.06);
    --shadow-md: 0 4px 20px rgba(44, 62, 62, 0.1);
    --shadow-lg: 0 8px 40px rgba(44, 62, 62, 0.12);
    --shadow-aqua: 0 4px 20px rgba(54, 178, 174, 0.25);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* --- Header --- */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(244, 239, 224, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(222, 199, 152, 0.3);
    transition: var(--transition);
}
.header-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.logo-group { display: flex; align-items: center; gap: 16px; }
.logo-redes {
    font-family: 'Cambria', 'Georgia', serif;
    font-weight: 400; font-size: 2rem;
    color: var(--aqua); letter-spacing: 3px;
}
.logo-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; font-size: 0.6rem;
    color: var(--text-medium); line-height: 1.4;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-left: 2px solid var(--beige); padding-left: 12px;
}
.nav { display: flex; gap: 8px; }
.nav-link {
    text-decoration: none; color: var(--text-medium);
    font-size: 0.85rem; font-weight: 500;
    padding: 8px 16px; border-radius: var(--radius-sm);
    transition: var(--transition); position: relative;
}
.nav-link:hover, .nav-link.active { color: var(--aqua); background: var(--aqua-glow); }
.mobile-menu-btn {
    display: none; background: none; border: none; cursor: pointer;
    width: 32px; height: 24px; position: relative; flex-direction: column;
    justify-content: space-between;
}
.mobile-menu-btn span {
    display: block; width: 100%; height: 2px; background: var(--text-dark);
    border-radius: 2px; transition: var(--transition);
}

/* --- Hero --- */
.hero {
    min-height: 92vh; display: flex; align-items: center; justify-content: center;
    text-align: center; position: relative; overflow: hidden;
    padding: 120px 24px 80px;
}
.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }
.shape {
    position: absolute; border-radius: 50%; opacity: 0.12;
    animation: float 8s ease-in-out infinite;
}
.shape-1 {
    width: 500px; height: 500px; background: var(--aqua);
    top: -100px; right: -100px; animation-delay: 0s;
}
.shape-2 {
    width: 350px; height: 350px; background: var(--beige);
    bottom: -80px; left: -80px; animation-delay: 2s;
}
.shape-3 {
    width: 200px; height: 200px; background: var(--aqua);
    top: 50%; left: 10%; animation-delay: 4s;
}
@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero-badge {
    display: inline-block; background: var(--aqua-glow);
    color: var(--aqua); font-size: 0.8rem; font-weight: 600;
    padding: 8px 20px; border-radius: 50px;
    margin-bottom: 24px; letter-spacing: 1px;
    border: 1px solid rgba(54, 178, 174, 0.2);
}
.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700;
    line-height: 1.2; margin-bottom: 20px; color: var(--text-dark);
}
.highlight {
    color: var(--aqua); position: relative;
    background: linear-gradient(120deg, var(--aqua-glow) 0%, transparent 100%);
    padding: 0 8px; border-radius: 4px;
}
.hero-text {
    font-size: 1.05rem; color: var(--text-medium);
    max-width: 540px; margin: 0 auto 32px; line-height: 1.7;
}

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    font-family: 'Montserrat', sans-serif; font-weight: 600;
    font-size: 0.9rem; border: none; cursor: pointer;
    border-radius: var(--radius-md); padding: 14px 32px;
    transition: var(--transition); text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--aqua), var(--aqua-dark));
    color: white; box-shadow: var(--shadow-aqua);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(54, 178, 174, 0.35);
}
.btn-secondary {
    background: transparent; color: var(--aqua);
    border: 2px solid var(--aqua-glow); padding: 12px 24px;
}
.btn-secondary:hover { background: var(--aqua-glow); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* --- Sections --- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-header { text-align: center; margin-bottom: 56px; }
.section-badge {
    display: inline-block; background: var(--aqua-glow);
    color: var(--aqua); font-size: 0.75rem; font-weight: 600;
    padding: 6px 18px; border-radius: 50px;
    margin-bottom: 16px; letter-spacing: 1px; text-transform: uppercase;
}
.section-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700;
    color: var(--text-dark); margin-bottom: 12px;
}
.section-desc { color: var(--text-medium); max-width: 500px; margin: 0 auto; font-size: 0.95rem; }

/* --- Professionals Grid --- */
.professionals-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
}
.prof-card {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 36px 28px; text-align: center;
    box-shadow: var(--shadow-sm); transition: var(--transition);
    border: 1px solid rgba(222, 199, 152, 0.2);
    position: relative; overflow: hidden;
}
.prof-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: linear-gradient(90deg, var(--aqua), var(--beige));
}
.prof-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.prof-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, var(--aqua-glow), var(--beige-light));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; overflow: hidden;
    border: 3px solid var(--beige-light);
    box-shadow: 0 4px 12px rgba(54, 178, 174, 0.15);
}
.prof-avatar img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: center top;
}
.prof-name { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.prof-specialty { font-size: 0.82rem; color: var(--aqua); font-weight: 600; margin-bottom: 12px; }
.prof-schedule { font-size: 0.78rem; color: var(--text-light); line-height: 1.8; }
.prof-schedule-day { display: flex; justify-content: space-between; padding: 2px 0; }
.prof-schedule-day span:first-child { font-weight: 500; color: var(--text-medium); }

/* --- Booking Card --- */
.booking-card {
    background: var(--white); border-radius: var(--radius-xl);
    padding: 48px; box-shadow: var(--shadow-md);
    max-width: 700px; margin: 0 auto;
    border: 1px solid rgba(222, 199, 152, 0.15);
}
.steps-indicator {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-bottom: 40px;
}
.step-dot {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    position: relative;
}
.step-dot span {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
    background: var(--bg); color: var(--text-light);
    border: 2px solid var(--bg-alt); transition: var(--transition);
}
.step-dot.active span {
    background: var(--aqua); color: white;
    border-color: var(--aqua); box-shadow: var(--shadow-aqua);
}
.step-dot.completed span {
    background: var(--aqua-light); color: white; border-color: var(--aqua-light);
}
.step-dot small { font-size: 0.65rem; color: var(--text-light); font-weight: 500; }
.step-dot.active small { color: var(--aqua); }
.step-line {
    flex: 1; height: 2px; background: var(--bg-alt);
    max-width: 60px; margin: 0 8px; margin-bottom: 20px;
}
.step-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; text-align: center; }
.step-subtitle { text-align: center; color: var(--text-medium); font-size: 0.9rem; margin-bottom: 20px; }

/* --- Professional Selector --- */
.prof-select-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.prof-select-card {
    padding: 24px 16px; border-radius: var(--radius-md); text-align: center;
    cursor: pointer; border: 2px solid var(--bg-alt);
    transition: var(--transition); background: var(--bg);
}
.prof-select-card:hover { border-color: var(--aqua); background: var(--aqua-glow); }
.prof-select-card.selected { border-color: var(--aqua); background: var(--aqua-glow); }
.prof-select-card .ps-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--aqua-glow), var(--beige-light));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px; overflow: hidden;
    border: 2px solid var(--beige-light);
}
.prof-select-card .ps-avatar img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: center top;
}
.prof-select-card .ps-name { font-weight: 600; font-size: 0.85rem; color: var(--text-dark); }
.prof-select-card .ps-spec { font-size: 0.72rem; color: var(--text-light); margin-top: 4px; }

/* --- Calendar --- */
.calendar-container {
    max-width: 400px; margin: 0 auto 24px;
    background: var(--bg); border-radius: var(--radius-md); padding: 24px;
}
.calendar-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.cal-month { font-weight: 700; font-size: 1rem; color: var(--text-dark); text-transform: capitalize; }
.cal-nav {
    background: var(--white); border: 1px solid var(--bg-alt);
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 1.4rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: var(--transition); color: var(--text-medium);
}
.cal-nav:hover { background: var(--aqua); color: white; border-color: var(--aqua); }
.calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    text-align: center; font-size: 0.7rem; font-weight: 600;
    color: var(--text-light); margin-bottom: 8px; text-transform: uppercase;
}
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 0.82rem; font-weight: 500;
    cursor: pointer; transition: var(--transition); border: none; background: none;
    color: var(--text-dark);
}
.cal-day:hover:not(.disabled):not(.empty) { background: var(--aqua-glow); color: var(--aqua); }
.cal-day.selected { background: var(--aqua); color: white; box-shadow: var(--shadow-aqua); }
.cal-day.disabled { color: var(--text-light); opacity: 0.35; cursor: not-allowed; }
.cal-day.empty { cursor: default; }
.cal-day.today { border: 2px solid var(--beige); }

/* --- Time Slots --- */
.time-slots {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px; margin-bottom: 24px;
}
.time-slot {
    padding: 12px 8px; border-radius: var(--radius-sm); text-align: center;
    border: 2px solid var(--bg-alt); cursor: pointer; font-size: 0.88rem;
    font-weight: 600; transition: var(--transition); background: var(--bg);
    color: var(--text-dark);
}
.time-slot:hover { border-color: var(--aqua); background: var(--aqua-glow); }
.time-slot.selected { background: var(--aqua); color: white; border-color: var(--aqua); }
.time-slot.taken {
    background: var(--bg-alt); color: var(--text-light);
    cursor: not-allowed; text-decoration: line-through; opacity: 0.5;
}

/* --- Patient Form --- */
.patient-form { margin-top: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-medium); }
.form-group input, .form-group textarea, .form-group select {
    font-family: 'Montserrat', sans-serif;
    padding: 12px 16px; border-radius: var(--radius-sm);
    border: 2px solid var(--bg-alt); background: var(--bg);
    font-size: 0.88rem; color: var(--text-dark);
    transition: var(--transition); outline: none;
}
.form-group input:focus, .form-group textarea:focus {
    border-color: var(--aqua); background: white;
    box-shadow: 0 0 0 4px var(--aqua-glow);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.booking-summary {
    background: var(--bg); border-radius: var(--radius-sm); padding: 16px 20px;
    margin-bottom: 24px; font-size: 0.85rem; line-height: 1.8;
    border-left: 4px solid var(--aqua);
}
.booking-summary strong { color: var(--aqua); }

/* --- Success --- */
.success-container { text-align: center; padding: 20px 0; }
.success-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--aqua), var(--aqua-light));
    color: white; font-size: 2.5rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px; animation: popIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
.success-title { font-size: 1.5rem; color: var(--aqua); margin-bottom: 12px; }
.success-text { color: var(--text-medium); margin-bottom: 24px; }
.success-details {
    background: var(--bg); border-radius: var(--radius-sm); padding: 20px;
    text-align: left; margin-bottom: 28px; font-size: 0.85rem; line-height: 2;
}

/* --- Contact --- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.contact-card {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 32px; text-align: center;
    box-shadow: var(--shadow-sm); transition: var(--transition);
    border: 1px solid rgba(222, 199, 152, 0.15);
}
.contact-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.contact-icon { font-size: 2rem; margin-bottom: 16px; }
.contact-card h4 { font-weight: 700; margin-bottom: 8px; color: var(--text-dark); }
.contact-card p { color: var(--text-medium); font-size: 0.88rem; }

/* --- Footer --- */
.footer {
    background: var(--text-dark); color: rgba(255,255,255,0.7); padding: 40px 0;
}
.footer-inner {
    display: flex; justify-content: space-between; align-items: center;
}
.footer-brand p { font-size: 0.8rem; margin-top: 4px; }
.footer .logo-redes { color: var(--aqua); }
.footer-copy { font-size: 0.75rem; }

/* --- Toast --- */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--text-dark); color: white;
    padding: 14px 28px; border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500;
    box-shadow: var(--shadow-lg); z-index: 999;
    animation: slideUp 0.4s ease;
}
.toast.error { background: #c0392b; }
.toast.success { background: var(--aqua); }
@keyframes slideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .nav.open {
        display: flex; flex-direction: column;
        position: absolute; top: 72px; left: 0; right: 0;
        background: rgba(244, 239, 224, 0.97);
        backdrop-filter: blur(16px); padding: 16px;
        border-bottom: 1px solid var(--beige-light);
    }
    .logo-subtitle { display: none; }
    .hero { min-height: 80vh; padding: 100px 20px 60px; }
    .hero-title { font-size: 1.8rem; }
    .booking-card { padding: 28px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .prof-select-grid { grid-template-columns: 1fr; }
    .steps-indicator { gap: 0; }
    .step-dot small { font-size: 0.55rem; }
    .step-dot span { width: 30px; height: 30px; font-size: 0.7rem; }
    .step-line { max-width: 30px; }
    .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
    .form-actions { flex-direction: column; }
}

/* --- Loading Spinner --- */
.spinner {
    width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%;
    animation: spin 0.6s linear infinite; display: inline-block; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
