:root {
    --primary: #1a237e;
    --primary-dark: #0d1442;
    --primary-light: #283593;
    --secondary: #2979ff;
    --secondary-light: #5c9aff;
    --accent: #2979ff;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #ef6c00;
    --info: #1565c0;

    --surface: #ffffff;
    --surface-warm: #f8fafc;
    --bg-light: #f0f4f8;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-xs: 0 1px 2px rgba(26, 35, 126, 0.04);
    --shadow-sm: 0 1px 3px rgba(26, 35, 126, 0.06), 0 1px 2px rgba(26, 35, 126, 0.04);
    --shadow-md: 0 4px 6px rgba(26, 35, 126, 0.06), 0 2px 4px rgba(26, 35, 126, 0.04);
    --shadow-lg: 0 10px 15px rgba(26, 35, 126, 0.08), 0 4px 6px rgba(26, 35, 126, 0.04);
    --shadow-xl: 0 20px 25px rgba(26, 35, 126, 0.10), 0 8px 10px rgba(26, 35, 126, 0.04);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

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

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

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    max-height: 36px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.nav-brand h2 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
    background: var(--bg-light);
}

.nav-link.active {
    color: var(--primary);
    background: var(--surface-warm);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    margin-left: 0.5rem;
    border-left: 1px solid var(--border);
}

.nav-user span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Work Sans', sans-serif;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 0.375rem;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-header h1 {
    color: var(--primary);
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.auth-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--accent);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(200, 150, 102, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    animation: toastIn 0.3s ease-out;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--danger);
    color: white;
}

.toast-info {
    background: var(--info);
    color: white;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Booking Container */
.booking-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Progress Indicator */
.booking-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding: 0 2rem;
    position: relative;
}

.progress-line {
    position: absolute;
    top: 50%;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: var(--border);
    transform: translateY(-50%);
    z-index: 0;
    border-radius: 1px;
}

.progress-line-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 1px;
    transition: width 0.4s ease;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}

.progress-step.active .progress-dot {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.progress-step.completed .progress-dot {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.progress-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

.progress-step.active .progress-label {
    color: var(--primary);
    font-weight: 600;
}

.booking-step {
    margin-bottom: 1.5rem;
}

.booking-step.hidden {
    display: none;
}

.booking-step h3 {
    color: var(--primary);
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid var(--secondary);
}

.booking-step h3 .step-label {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

/* profesionales Grid */
.profesionales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.profesional-card {
    background: var(--surface-warm);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-slow);
}

.profesional-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.profesional-card.selected {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(200,150,102,0.08) 0%, rgba(212,115,94,0.08) 100%);
    box-shadow: 0 0 0 3px rgba(200,150,102,0.15);
}

.profesional-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 auto 0.75rem;
}

.profesional-card h4 {
    color: var(--primary);
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.profesional-card .speciality {
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.profesional-card .description {
    color: var(--text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

/* Servicios List */
.servicios-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.servicio-item {
    background: var(--surface-warm);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.servicio-item:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-xs);
}

.servicio-item.selected {
    border-color: var(--secondary);
    background: linear-gradient(135deg, rgba(200,150,102,0.08) 0%, rgba(212,115,94,0.08) 100%);
    box-shadow: 0 0 0 3px rgba(200,150,102,0.15);
}

.servicio-info h4 {
    color: var(--primary);
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.125rem;
}

.servicio-info p {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.servicio-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.125rem;
}

.servicio-meta .duration {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.servicio-meta .price {
    color: var(--secondary);
    font-weight: 700;
    font-size: 1.125rem;
}

/* Datetime Selector */
.datetime-selector {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.date-picker label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.date-picker input[type="date"] {
    width: 100%;
    max-width: 280px;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: 'Work Sans', sans-serif;
    transition: var(--transition);
}

.date-picker input[type="date"]:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(200, 150, 102, 0.12);
}

.horarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.625rem;
}

.horario-slot {
    padding: 0.625rem;
    background: var(--surface-warm);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.horario-slot:hover {
    border-color: var(--secondary);
    background: var(--surface);
}

.horario-slot.selected {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.text-muted {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem;
}

/* Booking Summary */
.booking-summary {
    background: var(--surface-warm);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
}

.summary-item:last-of-type {
    border-bottom: none;
}

.summary-item .label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.summary-item .value {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

/* Booking Actions */
.booking-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1.5px solid var(--border);
}

/* Turnos */
.turnos-container {
    max-width: 800px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.turnos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.turno-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    border-left: 3px solid var(--secondary);
    transition: var(--transition);
}

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

.turno-card.status-cancelado {
    opacity: 0.5;
    border-left-color: var(--danger);
}

.turno-card.status-completado {
    border-left-color: var(--success);
}

.turno-header {
    display: flex;
    padding: 1.25rem;
    gap: 1rem;
}

.turno-date {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    min-width: 60px;
    text-align: center;
}

.date-day {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
    opacity: 0.9;
}

.turno-info {
    flex: 1;
}

.turno-info h3 {
    color: var(--primary);
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.375rem;
}

.turno-info .profesional {
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.turno-info .datetime {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.turno-status {
    align-self: flex-start;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-pendiente {
    background: #fef9e7;
    color: #7c5e10;
    border: 1px solid #fdebb3;
}

.badge-confirmado {
    background: #e8f4fd;
    color: #1a5a8c;
    border: 1px solid #b8dff5;
}

.badge-cancelado {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-completado {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-success {
    background: var(--success);
    color: white;
}

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

.turno-details {
    padding: 0 1.25rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.625rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.625rem;
    background: var(--surface-warm);
    border-radius: var(--radius-sm);
}

.detail-item.full-width {
    grid-column: 1 / -1;
    flex-direction: column;
}

.detail-item .label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.detail-item .value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.turno-actions {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .nav-container {
        padding: 0 1rem;
        height: 56px;
    }

    .nav-menu {
        gap: 0.25rem;
        font-size: 0.85rem;
    }

    .nav-user {
        padding-left: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .profesionales-grid {
        grid-template-columns: 1fr;
    }

    .booking-actions {
        flex-direction: column;
    }

    .booking-actions .btn {
        width: 100%;
    }

    .horarios-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .turno-header {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .booking-progress {
        padding: 0 1rem;
    }

    .progress-label {
        display: none;
    }

    .booking-progress::before,
    .booking-progress::after {
        left: 1rem;
        right: 1rem;
    }

    .container {
        padding: 1rem;
    }

    .booking-container {
        padding: 1.25rem;
    }

    .auth-box {
        padding: 2rem 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .profesionales-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .turno-header {
        gap: 1rem;
    }
}

/* Site Footer */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
}

.site-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}
