/* Variables y reset */
:root {
    --primary: #0077B6;        /* Azul salud */
    --secondary: #00B4D8;      /* Turquesa */
    --accent: #48CAE4;
    --dark: #023E8A;
    --light: #CAF0F8;
    --white: #ffffff;
    --gray: #6c757d;
    --gray-light: #f8f9fa;
    --success: #06A77D;
    --danger: #DC2F02;
    --shadow: 0 4px 12px rgba(0, 119, 182, 0.15);
    --radius: 10px;
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: #333;
    line-height: 1.6;
    background: var(--white);
}

a { color: var(--primary); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--secondary); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.top-bar {
    background: var(--dark);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.9rem;
}
.top-bar .container { display: flex; justify-content: space-between; flex-wrap: wrap; }
.top-bar a { color: var(--white); margin-left: 15px; }

header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 55px; }
.logo h1 { color: var(--primary); font-size: 1.4rem; }
.logo small { display: block; color: var(--gray); font-size: 0.75rem; }

nav ul { list-style: none; display: flex; gap: 25px; }
nav a {
    color: var(--dark);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
}
nav a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--secondary);
    transition: 0.3s;
}
nav a:hover::after, nav a.active::after { width: 100%; }

.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--primary); cursor: pointer; }

/* Hero */
.hero {
    background: linear-gradient(135deg, rgba(0,119,182,0.9), rgba(0,180,216,0.85)),
                url('../img/hero.jpg') center/cover;
    color: var(--white);
    padding: 100px 0;
    text-align: center;
}
.hero h2 { font-size: 3rem; margin-bottom: 20px; }
.hero p { font-size: 1.3rem; margin-bottom: 30px; max-width: 700px; margin-inline: auto; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    text-align: center;
}
.btn-primary { background: var(--secondary); color: var(--white); }
.btn-primary:hover { background: var(--dark); color: var(--white); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--white); margin-left: 10px; }
.btn-outline:hover { background: var(--white); color: var(--primary); }

/* Secciones */
section { padding: 70px 0; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 { color: var(--dark); font-size: 2.2rem; margin-bottom: 10px; }
.section-title p { color: var(--gray); font-size: 1.1rem; }
.section-title::after {
    content: '';
    display: block;
    width: 70px; height: 4px;
    background: var(--secondary);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Servicios */
.servicios-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; }
.servicio-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: 0.3s;
    border-top: 4px solid var(--secondary);
}
.servicio-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.servicio-card i { font-size: 3rem; color: var(--primary); margin-bottom: 15px; }
.servicio-card h3 { color: var(--dark); margin-bottom: 10px; }

/* Info boxes */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 40px; }
.info-box {
    background: var(--light);
    padding: 25px;
    border-radius: var(--radius);
    text-align: center;
}
.info-box i { font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.info-box h4 { color: var(--dark); margin-bottom: 8px; }

/* Formulario */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--dark); }
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: 0.3s;
}
.form-control:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,180,216,0.2); }
textarea.form-control { min-height: 120px; resize: vertical; }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info { background: var(--light); padding: 30px; border-radius: var(--radius); }
.contact-info-item { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
.contact-info-item i { font-size: 1.5rem; color: var(--primary); margin-top: 3px; }

/* WhatsApp flotante */
.whatsapp-float {
    position: fixed;
    bottom: 25px; right: 25px;
    background: #25D366;
    color: var(--white);
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(37,211,102,0.4);
    z-index: 999;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 50px 0 20px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { margin-bottom: 15px; color: var(--accent); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #ccc; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    nav ul {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
    }
    nav ul.active { display: flex; }
    .hero h2 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .contact-grid { grid-template-columns: 1fr; }
    .btn-outline { margin: 10px 0 0 0; display: block; }
}
/* Sistema de turnos */
.turnos-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    background: var(--gray-light);
    padding: 20px;
    border-radius: var(--radius);
}
.step {
    flex: 1;
    text-align: center;
    color: var(--gray);
    font-weight: 500;
    position: relative;
}
.step span {
    display: inline-block;
    width: 30px; height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: var(--gray);
    color: white;
    margin-right: 8px;
    font-weight: bold;
}
.step.active { color: var(--primary); }
.step.active span { background: var(--primary); }

.turnos-form h3 {
    color: var(--dark);
    margin: 20px 0 15px;
    border-bottom: 2px solid var(--light);
    padding-bottom: 8px;
}

.servicio-card.selectable {
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}
.servicio-card.selectable input[type="radio"] {
    position: absolute;
    opacity: 0;
}
.servicio-card.selectable:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,119,182,0.2);
}
.servicio-card.selectable.selected {
    background: var(--light);
    border-color: var(--primary);
    border-width: 2px;
}
.servicio-card.selectable.selected::after {
    content: '✓';
    position: absolute;
    top: 10px; right: 10px;
    background: var(--success);
    color: white;
    width: 25px; height: 25px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
}

.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}
.horario-btn {
    padding: 12px;
    background: var(--white);
    border: 2px solid var(--light);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}
.horario-btn:hover {
    background: var(--light);
    border-color: var(--secondary);
}
.horario-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .turnos-steps { flex-direction: column; gap: 10px; }
    .step { text-align: left; }
}
/* Panel Admin */
.admin-container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.admin-container h1 { color: var(--dark); margin-bottom: 10px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
}
.stat-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 1.5rem;
    position: relative;
}
.stat-info h3 { font-size: 2rem; color: var(--dark); margin: 0; }
.stat-info p { color: var(--gray); margin: 0; font-size: 0.9rem; }

.badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 22px; height: 22px;
    font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}
.badge-new {
    background: var(--danger);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) { .admin-grid-2 { grid-template-columns: 1fr; } }

.admin-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}
.admin-card h3 {
    color: var(--dark);
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background: var(--gray-light); color: var(--dark); font-weight: 600; }

.badge-estado {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-pendiente { background: #fff3cd; color: #856404; }
.badge-confirmado { background: #d1ecf1; color: #0c5460; }
.badge-atendido { background: #d4edda; color: #155724; }
.badge-cancelado { background: #f8d7da; color: #721c24; }

.mensaje-item {
    padding: 12px;
    border-left: 3px solid #ddd;
    margin-bottom: 10px;
    background: var(--gray-light);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.mensaje-item.nuevo {
    border-left-color: var(--primary);
    background: var(--light);
}
.mensaje-item strong { color: var(--dark); }
.mensaje-item small { color: var(--gray); float: right; }
.mensaje-item p { margin: 5px 0 0; font-size: 0.9rem; color: #555; }

/* Header admin */
.admin-header {
    background: var(--dark);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
}
.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}
.admin-header nav a {
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius);
    transition: 0.3s;
}
.admin-header nav a:hover, .admin-header nav a.active {
    background: var(--primary);
}