
/* Fix Modale Riprogrammazione */
#reschedule-modal .modal-dialog {
    max-width: 90vw !important;
    margin: 1.75rem auto;
}

#reschedule-modal .modal-content {
    height: 85vh;
    display: flex;
    flex-direction: column;
}

#reschedule-modal .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

#reschedule-calendar {
    height: 100% !important;
}

/* Su mobile: toolbar compatta e slot più bassi per vedere più appuntamenti */
@media (max-width: 768px) {
    #reschedule-modal .fc .fc-header-toolbar .fc-toolbar-chunk:nth-child(3),
    #nutrition-reschedule-modal .fc .fc-header-toolbar .fc-toolbar-chunk:nth-child(3) {
        display: flex !important;
    }
    #reschedule-modal .fc .fc-footer-toolbar,
    #nutrition-reschedule-modal .fc .fc-footer-toolbar {
        display: none !important;
    }
    /* Riduci spazio toolbar */
    #reschedule-modal .fc .fc-toolbar,
    #nutrition-reschedule-modal .fc .fc-toolbar {
        padding: 0.35rem 0;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    #reschedule-modal .fc .fc-toolbar.fc-header-toolbar,
    #nutrition-reschedule-modal .fc .fc-toolbar.fc-header-toolbar {
        flex-direction: row;
        font-size: 0.75rem;
    }
    #reschedule-modal .fc .fc-toolbar-chunk,
    #nutrition-reschedule-modal .fc .fc-toolbar-chunk {
        gap: 0.2rem;
    }
    #reschedule-modal .fc .fc-button,
    #nutrition-reschedule-modal .fc .fc-button {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    #reschedule-modal .fc .fc-toolbar-title,
    #nutrition-reschedule-modal .fc .fc-toolbar-title {
        font-size: 0.9rem;
    }
    /* Slot orari più compatti: più ore visibili senza scroll */
    #reschedule-modal .fc-timegrid-slot,
    #nutrition-reschedule-modal .fc-timegrid-slot {
        min-height: 2rem !important;
    }
    #reschedule-modal .fc-timegrid-slot-label,
    #nutrition-reschedule-modal .fc-timegrid-slot-label {
        font-size: 0.7rem;
    }
}
/* assets/css/style.css */
/* Stili globali e per la pagina di login */

/* === VARIABILI CSS === */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    --sidebar-width: 250px;
    --header-height: 60px;
    
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* === RESET E BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

/* === PAGINA DI LOGIN === */
.login-page {
    background: linear-gradient(-45deg, #667eea, #764ba2, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    padding: 2rem;
    animation: slideUp 0.6s ease;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    margin-bottom: 1rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.login-header .logo img {
    width: 80px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-header h1 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-form .input-group {
    margin-bottom: 1rem;
}

/* Stili per floating labels */
.login-form .form-floating {
    position: relative;
}

.login-form .form-floating label {
    color: #6c757d;
    transition: all 0.3s ease;
}

.login-form .form-floating > .form-control:focus ~ label,
.login-form .form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--primary-color);
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.login-form .form-floating > .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Stili per il pulsante show/hide password con floating label */
.login-form .input-group .form-floating {
    flex: 1;
}

.login-form .input-group .form-floating .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.login-form .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-form .btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#forgot-password-inline {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.login-form .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* === ALERT SYSTEM === */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.alert {
    margin-bottom: 10px;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    animation: slideInRight 0.3s ease;
}

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

.alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert .btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    opacity: 0.7;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
}

.loading-message {
    margin-top: 1rem;
    color: var(--secondary-color);
}

/* === MODAL STYLES === */
.modal {
    z-index: 9999;
}

.modal-backdrop {
    z-index: 9998;
}

.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

/* Stabilizza la modal login su Safari iOS */
#forgot-password-modal .modal-dialog {
    margin: 1rem auto;
    max-width: min(460px, calc(100vw - 1rem));
}

#forgot-password-modal .modal-content {
    max-height: calc(100dvh - 2rem);
}

#forgot-password-modal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* === FORM STYLES === */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
}

.is-invalid {
    border-color: var(--danger-color);
}

/* === TABLE STYLES === */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background-color: var(--dark-color);
    color: white;
    border: none;
    font-weight: 500;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,0.05);
}

.table .amount {
    text-align: right;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

/* === BUTTON STYLES === */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    transform: none;
}

.btn-group .btn:hover {
    transform: none;
}

/* === UTILITY CLASSES === */
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }

/* === CARD STYLES === */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    font-weight: 500;
}

/* === BADGE STYLES === */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
}

/* === EMPTY STATES === */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--secondary-color);
}

.empty-state i {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* === LOADING STATES === */
.loading-placeholder {
    text-align: center;
    color: var(--secondary-color);
    font-style: italic;
    padding: 2rem;
}

.error-state {
    text-align: center;
    color: var(--danger-color);
    font-weight: 500;
    padding: 2rem;
}

/* === RESPONSIVE DESIGN === */

/* Tablet Landscape */
@media (max-width: 1024px) {
    .login-card {
        padding: 1.75rem;
    }
    
    .alert-container {
        max-width: 350px;
    }
    
    .modal-dialog {
        margin: 1.5rem;
    }
    
    .notification-container {
        max-width: 320px;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .login-header .logo img {
        width: 72px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .alert-container {
        left: 15px;
        right: 15px;
        max-width: none;
        top: 15px;
    }
    
    .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .notification-container {
        left: 15px;
        right: 15px;
        max-width: none;
        top: 15px;
    }
    
    .notification {
        padding: 0.875rem;
        margin-bottom: 8px;
    }
    
    .loading-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    /* Form improvements for mobile */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* Mobile Landscape */
@media (max-width: 640px) {
    .login-page {
        padding: 15px;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .login-card {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    .login-header .logo img {
        width: 64px;
    }
    
    .login-header h1 {
        font-size: 1.25rem;
    }
    
    .alert-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .notification-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .loading-content {
        padding: 1.25rem;
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    
    /* Table improvements */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.375rem;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .login-page {
        padding: 10px;
    }
    
    .login-card {
        padding: 1rem;
        margin: 0;
        border-radius: 12px;
    }
    
    .login-header {
        margin-bottom: 1.5rem;
    }
    
    .login-header .logo img {
        width: 56px;
    }
    
    .login-header h1 {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }
    
    .login-form .input-group {
        margin-bottom: 0.875rem;
    }
    
    .login-form .btn-primary {
        padding: 14px;
        font-size: 16px;
    }
    
    .alert-container {
        left: 5px;
        right: 5px;
        top: 5px;
    }
    
    .alert {
        margin-bottom: 8px;
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }

    #forgot-password-modal .modal-dialog {
        margin: 0.5rem auto;
        max-width: calc(100vw - 1rem);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.875rem;
    }
    
    .modal-header h5 {
        font-size: 1.125rem;
    }
    
    .notification-container {
        left: 5px;
        right: 5px;
        top: 5px;
    }
    
    .notification {
        padding: 0.75rem;
        margin-bottom: 6px;
        font-size: 0.875rem;
    }
    
    .loading-content {
        padding: 1rem;
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }
    
    .loading-message {
        font-size: 0.875rem;
    }
    
    /* Form improvements */
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
    
    .form-control,
    .form-select {
        padding: 0.75rem;
        font-size: 16px;
    }
    
    .form-floating {
        margin-bottom: 0.875rem;
    }
    
    .form-floating .form-control {
        padding: 1rem 0.75rem 0.25rem;
    }
    
    .form-floating label {
        font-size: 0.875rem;
    }
    
    /* Button improvements */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .btn-group .btn {
        padding: 8px 12px;
    }
    
    /* Table improvements */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.375rem 0.25rem;
        white-space: nowrap;
    }
    
    .table .amount {
        font-size: 0.75rem;
    }
    
    /* Card improvements */
    .card-body {
        padding: 0.875rem;
    }
    
    .card-header {
        padding: 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Badge improvements */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Empty state improvements */
    .empty-state {
        padding: 2rem 0.5rem;
    }
    
    .empty-state i {
        font-size: 2rem;
    }
    
    .empty-state p {
        font-size: 0.875rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .login-page .form-control,
    .login-page .form-select,
    #forgot-password-modal .form-control {
        font-size: 16px !important; /* evita zoom/input freeze su iOS */
    }
}

/* Extra Small Devices */
@media (max-width: 360px) {
    .login-card {
        padding: 0.875rem;
    }
    
    .login-header .logo img {
        width: 48px;
    }
    
    .login-header h1 {
        font-size: 1rem;
    }
    
    .alert-container {
        left: 2px;
        right: 2px;
        top: 2px;
    }
    
    .modal-dialog {
        margin: 0.125rem;
        max-width: calc(100vw - 0.25rem);
    }
    
    .notification-container {
        left: 2px;
        right: 2px;
        top: 2px;
    }
    
    .loading-content {
        padding: 0.875rem;
        margin: 0.125rem;
        max-width: calc(100vw - 0.25rem);
    }
    
    .form-control,
    .form-select {
        padding: 0.625rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.25rem;
        font-size: 0.75rem;
    }
}

/* Landscape Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .login-page {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .login-card {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .login-header {
        margin-bottom: 1rem;
    }
    
    .login-header .logo img {
        width: 48px;
    }
    
    .login-header h1 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .alert-container {
        top: 5px;
    }
    
    .modal-dialog {
        margin: 0.5rem auto;
    }
    
    .loading-content {
        padding: 1rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .login-card {
        border: 0.5px solid rgba(0,0,0,0.1);
    }
    
    .modal-content {
        border: 0.5px solid rgba(0,0,0,0.1);
    }
    
    .card {
        border: 0.5px solid rgba(0,0,0,0.1);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .sidebar-menu .menu-item a {
        min-height: 44px;
        padding: 12px 1.5rem;
    }
    
    .modal-header .btn-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    .alert .btn-close {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .login-card {
        animation: none;
    }
    
    .alert {
        animation: none;
    }
    
    .fade-in,
    .slide-in-up {
        animation: none;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in-up {
    animation: slideInUp 0.3s ease;
}

/* === NOTIFICATION SYSTEM === */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.notification {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1rem;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
}

.notification.notification-success {
    border-left-color: var(--success-color);
}

.notification.notification-error {
    border-left-color: var(--danger-color);
}

.notification.notification-warning {
    border-left-color: var(--warning-color);
}

.notification.notification-info {
    border-left-color: var(--info-color);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

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

/* === CONFIRM MODAL === */
.modal-confirm .modal-dialog {
    max-width: 400px;
}

.modal-confirm .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-confirm .modal-footer {
    border-top: none;
    padding-top: 0;
}

/* === SKELETON LOADERS === */
@keyframes skeleton-loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 8px;
}

/* Skeleton per le card delle sedi */
.location-card-skeleton { 
    height: 150px; 
}

/* Skeleton per la pagina degli orari */
.day-column-skeleton { 
    min-width: 250px; 
}

.day-column-skeleton .day-header-skeleton { 
    height: 60px; 
    margin-bottom: 1rem; 
}

.day-column-skeleton .slot-group-skeleton { 
    height: 80px; 
    margin-bottom: 1rem; 
}

/* Responsive per card sedi su mobile */
@media (max-width: 576px) {
    .location-card .card-body {
        padding: 1.5rem !important;
    }
}

/* =============================================== */
/* ===     Micro-interazioni & Feedback        === */
/* =============================================== */

/* Card Sedi (in scegli-sede.html) */
.location-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
}

/* Slot Orari (in index.html di prenota) */
.slot-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.slot-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.slot-card:active {
    transform: scale(0.98); /* Effetto "premuto" */
    transition-duration: 0.1s;
}

/* Pulsanti */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:active {
    transform: scale(0.97); /* Effetto "premuto" per tutti i pulsanti */
}

/* =============================================== */
/* ===      Gerarchia Visiva & Spacing         === */
/* =============================================== */

/* Sfondo più luminoso e moderno */
body {
    background-color: #F9FAFB; /* Grigio molto chiaro, quasi bianco */
}

.hero-section {
    /* Gradiente più soft */
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Migliora il titolo della pagina */
.hero-section h1 {
    font-weight: 700; /* Più audace */
}

/* Card principali con più respiro */
.availability-container, .timetable-container {
    padding: 2rem; /* Più padding interno */
    border: 1px solid #E5E7EB; /* Bordo sottile per definirla meglio */
}

/* Titoli delle sezioni più evidenti */
.card-title {
    font-weight: 600;
    color: #111827; /* Nero quasi puro per massimo contrasto */
}

/* Bottoni (CTA) che spiccano di più */
.btn-primary {
    --bs-btn-bg: #4f46e5; /* Il nostro nuovo blu/viola */
    --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
    font-weight: 600;
    padding: 0.75rem 1.5rem; /* Pulsanti leggermente più grandi */
}

/* Intestazioni delle colonne-giorno */
.day-header {
    background: #F3F4F6; /* Grigio chiaro */
    color: #374151; /* Testo scuro */
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
    border: 1px solid #E5E7EB;
}

/* =============================================== */
/* ===         Stile Lista Prenotazioni        === */
/* =============================================== */
.booking-list-day-header {
    font-weight: 600;
    color: #4F46E5;
    padding: 1rem 0.5rem;
    border-bottom: 2px solid #E5E7EB;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}
.slot-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.slot-list-item:hover {
    background-color: #f9faff;
}
.slot-list-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}
.slot-list-item .date-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #f3f4f6;
    border-radius: 8px;
    margin-right: 1rem;
    font-weight: 600;
}
.slot-list-item .date-icon .day {
    font-size: 1.2rem;
}
.slot-list-item .date-icon .month {
    font-size: 0.7rem;
    text-transform: uppercase;
}
.slot-list-item .info {
    flex-grow: 1;
}
.slot-list-item .info .trainer-name {
    font-weight: 600;
    color: #111827;
}
.slot-list-item .info .time-details {
    font-size: 0.9em;
    color: #6B7280;
}
.slot-list-item .availability {
    text-align: center;
}
.slot-list-item .availability .spots-pill {
    padding: 0.3rem 0.8rem;
    font-weight: 600;
    border-radius: 50px;
}
.slot-list-item .availability .spots-pill.available {
    background-color: #d1fae5;
    color: #065f46;
}
.slot-list-item .availability .spots-pill.full {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Micro-interazione al click sugli slot */
.slot-list-item:active {
    transform: scale(0.98);
    background-color: #e9ecef;
    transition: transform 0.1s ease;
}

/* Sticky header per i giorni nella lista */
.booking-list-day-header {
    position: sticky;
    top: 0;
    background-color: #F9FAFB;
    z-index: 10;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

/* =============================================== */
/* ===       FIX MODALI DESKTOP & MOBILE       === */
/* =============================================== */
/* Fix altezza per Safari Mobile su container principali */
.login-page, 
.dashboard-container {
    min-height: 100vh;
    min-height: 100dvh;
}

/* --- STILE MODALI --- */
/* Default (Mobile): Margini ridotti, larghezza quasi piena */
.modal-dialog {
    min-height: auto !important; /* Annulla vecchi fix */
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
}

/* Tablet e Desktop (min-width: 576px è lo standard Bootstrap 'sm') */
@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px; /* Larghezza standard Bootstrap */
        margin: 1.75rem auto; /* Margine standard Bootstrap */
    }
    
    /* Modali Grandi (Large) */
    .modal-lg .modal-dialog {
        max-width: 800px;
    }
    
    /* Modali Extra Grandi (X-Large) */
    .modal-xl .modal-dialog {
        max-width: 1140px;
    }
}

/* Assicuriamoci che il contenuto non sbordi */
.modal-content {
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden; /* Evita scrollbar doppie */
}

/* Fix per il corpo del modale se troppo lungo */
.modal-body {
    overflow-y: auto;
    max-height: 80vh; /* Evita che il modale sia più alto dello schermo */
}

/* Fix specifico per Safari Mobile nella visualizzazione modale */
@supports (-webkit-touch-callout: none) {
    .modal-dialog {
        /* Un po' di margine in basso per la barra di navigazione iOS */
        margin-bottom: env(safe-area-inset-bottom); 
    }
}

/* ============================================================ */
/* ===  APP REDESIGN (PRENOTAZIONI & DISDETTE PUBLICHE)     === */
/* ============================================================ */

/* 1. SFONDO & HERO: Più pulito, meno oppressivo */
body {
    background-color: #f4f7f6; /* Grigio/Azzurro chiarissimo, molto moderno */
}

.hero-section {
    /* Gradient solo in alto, curvo come le app native */
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    padding: 2.5rem 0 5rem 0; /* Spazio extra sotto per l'effetto sovrapposizione */
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    margin-bottom: -3.5rem; /* Le card saliranno sopra questo spazio */
    position: relative;
    z-index: 0;
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.3);
}

.hero-section h2 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

/* Container che "galleggia" sopra l'header */
.app-content-overlap {
    position: relative;
    z-index: 10;
}

/* 2. CARD MODERNE (Glassmorphism leggero e ombre morbide) */
.card-app {
    border: none;
    border-radius: 20px; /* Angoli molto arrotondati (stile iOS) */
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-app:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-app .card-body {
    padding: 1.5rem;
}

/* 3. PULSANTI "APP-LIKE" */
.btn-app {
    border-radius: 14px; /* Arrotondati ma non a pillola */
    padding: 14px 20px; /* Area di tocco grande per le dita */
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Spazio tra icona e testo */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-app i {
    font-size: 1.3rem; /* Icone grandi e leggibili */
}

/* Bottone Primario (Viola/Blu) */
.btn-app-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}
.btn-app-primary:hover {
    color: white;
    filter: brightness(110%);
    transform: translateY(-1px);
}
.btn-app-primary:active {
    transform: scale(0.98);
}

/* Bottone Cancellazione (Soft, non aggressivo) */
.btn-app-danger-soft {
    background-color: #FEF2F2; /* Rosso pallidissimo */
    color: #DC2626; /* Rosso scuro testo */
    border: 1px solid transparent;
}
.btn-app-danger-soft:hover {
    background-color: #FEE2E2;
    border-color: #FECACA;
    color: #B91C1C;
}

/* Link indietro "Back" */
.nav-back-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}
.nav-back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 4. LAYOUT "BIGLIETTO" PER LE PRENOTAZIONI (User Experience Migliorata) */
.booking-ticket {
    display: flex;
    flex-direction: column;
    padding: 0;
}

@media (min-width: 576px) {
    .booking-ticket {
        flex-direction: row;
        align-items: center;
    }
}

/* Box Data (Sinistra) */
.ticket-date {
    background: #EEF2FF; /* Viola chiarissimo */
    color: #4F46E5;
    padding: 15px;
    border-radius: 16px; /* Coerente con la card */
    min-width: 70px;
    text-align: center;
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Su mobile lo mettiamo a fianco al titolo */
    float: left; 
}

@media (max-width: 575px) {
    .ticket-date { margin-bottom: 10px; }
}

.ticket-date .day {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
}
.ticket-date .month {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 3px;
}

/* Info Centrali */
.ticket-info {
    flex-grow: 1;
    padding: 5px 0;
}

.ticket-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 4px;
}

.ticket-time {
    color: #6B7280;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Badge "Scadenza Cancellazione" (Meno testo, più visuale) */
.deadline-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    background-color: #F3F4F6;
    color: #6B7280;
    padding: 4px 10px;
    border-radius: 6px;
    margin-top: 8px;
}
.deadline-badge i { font-size: 0.8rem; }
.deadline-badge.warning { background-color: #FFFBEB; color: #D97706; }

/* 5. INPUT FORM PIÙ BELLI */
.form-control-app {
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.2s;
}
.form-control-app:focus {
    background-color: #fff;
    border-color: #4F46E5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.form-label-app {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 6px;
    margin-left: 4px;
}

/* FIX HERO SECTION */
.hero-section {
    /* Aumentiamo il padding sotto per dare spazio al titolo prima che inizi il box bianco */
    padding-bottom: 9rem !important; 
    position: relative;
}

/* Assicuriamo che il testo sia ben visibile e distanziato */
#location-name-title {
    margin-top: 1rem;
    position: relative;
    z-index: 2; /* Porta il testo sopra eventuali decorazioni */
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Sistemiamo il badge della sede e il tasto indietro */
.nav-back-link {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* FIX SLOT VERDI (TESTO INVISIBILE) */
.badge-slot-available {
    background-color: #d1fae5 !important; /* Verde chiaro sfondo */
    color: #065f46 !important; /* Verde scuro testo */
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
}

.badge-slot-full {
    background-color: #f3f4f6 !important; /* Grigio sfondo */
    color: #6b7280 !important; /* Grigio testo */
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
}

/* --- STILE CARD PRENOTAZIONI --- */
.booking-card {
    background: white;
    border: none;
    border-radius: 16px; /* Arrotondato moderno */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Ombra morbida */
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 6px solid #4F46E5; /* Bordo colorato a sinistra (stato) */
    position: relative;
    overflow: hidden;
}

.booking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Varianti colore per stato */
.booking-card.confirmed { border-left-color: #4F46E5; } /* Blu - Futura */
.booking-card.completed { border-left-color: #10B981; } /* Verde - Fatta */
.booking-card.cancelled { border-left-color: #EF4444; opacity: 0.7; } /* Rosso - Cancellata */
.booking-card.noshow { border-left-color: #F59E0B; } /* Giallo - Assente */

/* Layout interno card */
.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.booking-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1F2937;
}

.booking-time {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4F46E5;
    line-height: 1;
}

.booking-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #6B7280;
    font-size: 0.9rem;
}

.booking-icon {
    width: 20px;
    text-align: center;
    margin-right: 8px;
    color: #9CA3AF;
}

/* Badge Stato (pillola) */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.confirmed { background: #E0E7FF; color: #4338CA; }
.status-badge.completed { background: #D1FAE5; color: #065F46; }
.status-badge.cancelled { background: #FEE2E2; color: #991B1B; }

/* Tasto Azione (Disdici) */
.action-btn {
    margin-top: 15px;
    width: 100%;
    border-radius: 10px;
    padding: 10px;
    font-weight: 600;
}

/* === PWA INSTALL BUTTON === */
#pwa-install-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 999px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    z-index: 9998;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
    justify-content: center;
}

/* Nascondi automaticamente se l'app è in modalità standalone */
@media (display-mode: standalone) {
    #pwa-install-btn,
    #pwa-ios-overlay {
        display: none !important;
    }
}

#pwa-install-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.5);
}

#pwa-install-btn:active {
    transform: translateX(-50%) translateY(0);
}

#pwa-install-btn.hidden {
    display: none !important;
}

#pwa-install-btn i {
    font-size: 18px;
}

/* === PWA iOS OVERLAY === */
#pwa-ios-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

#pwa-ios-overlay.hidden {
    display: none !important;
}

.pwa-overlay-content {
    background: white;
    border-radius: 24px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: pwaOverlaySlideIn 0.3s ease-out;
}

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

.pwa-overlay-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 12px;
}

.pwa-overlay-content p {
    color: #6B7280;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.pwa-overlay-steps {
    background: #F9FAFB;
    border-radius: 16px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.pwa-overlay-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.pwa-overlay-step:last-child {
    margin-bottom: 0;
}

.pwa-overlay-step-number {
    background: #4F46E5;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pwa-overlay-step-text {
    flex: 1;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    padding-top: 2px;
}

.pwa-overlay-step-text strong {
    color: #1F2937;
    font-weight: 600;
}

.pwa-overlay-close {
    background: #4F46E5;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 10px;
}

.pwa-overlay-close:hover {
    background: #4338CA;
    transform: translateY(-1px);
}

.pwa-overlay-close:active {
    transform: translateY(0);
}

/* Icona iOS Safari */
.pwa-overlay-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #4F46E5;
}

/* Responsive: su schermi molto piccoli */
@media (max-width: 375px) {
    #pwa-install-btn {
        font-size: 14px;
        padding: 12px 20px;
        min-width: 180px;
    }
    
    .pwa-overlay-content {
        padding: 24px;
    }
    
    .pwa-overlay-content h3 {
        font-size: 1.3rem;
    }
}

/* --- PRENOTA: SCEGLI SEDE (layout desktop più pulito) --- */
body.choose-sede-page {
    --ll-brand-indigo: #4f46e5;
    --ll-brand-violet: #7c3aed;
    --ll-brand-cyan: #2563eb;
    --ll-brand-lime: #84cc16;
    --ll-brand-dark: #0f172a;
    --ll-brand-rose: #ef4444;
}

body.choose-sede-page .hero-section {
    background: linear-gradient(125deg, var(--ll-brand-dark) 0%, var(--ll-brand-indigo) 45%, var(--ll-brand-violet) 100%);
    padding: 1.75rem 0 4.75rem 0 !important;
}

body.choose-sede-page .app-content-overlap {
    margin-top: 0.25rem;
}

body.choose-sede-page #locations-list .card-app {
    margin-bottom: 0;
}

body.choose-sede-page #locations-list .card-app .card-body {
    min-height: 112px;
}

body.choose-sede-page .location-card {
    border-left: 6px solid var(--ll-brand-indigo);
    box-shadow: 0 12px 26px -10px rgba(15, 23, 42, 0.18), 0 8px 14px -12px rgba(79, 70, 229, 0.24);
}

body.choose-sede-page .location-card .location-icon-wrap {
    background: rgba(37, 99, 235, 0.12);
    color: var(--ll-brand-cyan);
}

body.choose-sede-page .location-card .location-card-chevron {
    color: var(--ll-brand-indigo);
    opacity: 0.7;
}

body.choose-sede-page .location-card.location-accent-1 {
    border-left-color: var(--ll-brand-lime);
}

body.choose-sede-page .location-card.location-accent-1 .location-icon-wrap {
    background: rgba(132, 204, 22, 0.14);
    color: #4d7c0f;
}

body.choose-sede-page .location-card.location-accent-1 .location-card-chevron {
    color: #65a30d;
}

body.choose-sede-page .location-card.location-accent-2 {
    border-left-color: var(--ll-brand-cyan);
}

body.choose-sede-page .location-card.location-accent-2 .location-icon-wrap {
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
}

body.choose-sede-page .location-card.location-accent-2 .location-card-chevron {
    color: #2563eb;
}

body.choose-sede-page .location-card.location-accent-3 {
    border-left-color: var(--ll-brand-rose);
}

body.choose-sede-page .location-card.location-accent-3 .location-icon-wrap {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

body.choose-sede-page .location-card.location-accent-3 .location-card-chevron {
    color: #ef4444;
}

@media (min-width: 992px) {
    body.choose-sede-page #locations-list .col-12 {
        max-width: 760px;
    }
}

/* --- Palette coerente pagine prenotazioni (prenota/disdici/nutrizione) --- */
body.prenota-main-page .hero-section,
body.prenota-disdici-page .hero-section,
body.prenota-nutri-page .hero-personal-area {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
}

body.prenota-main-page #booking-tabs .nav-link,
body.prenota-nutri-page #nutrition-tabs .nav-link {
    color: #4338ca;
    border: 1px solid #c7d2fe;
    background: #ffffff;
}

body.prenota-main-page #booking-tabs .nav-link.active,
body.prenota-nutri-page #nutrition-tabs .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-color: #4f46e5;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28);
}

body.prenota-disdici-page .btn-app-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    border-color: #4f46e5;
}

body.prenota-disdici-page .btn-app-primary:hover {
    filter: brightness(1.05);
}