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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    /* Forza la modalità chiara anche con dark mode attiva */
    color-scheme: light only;
}

html
{
    background-color: #f8fafc !important;
    color-scheme: light only;
    overscroll-behavior-y: none; /* aggiungi questa */
}

body
{
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc !important;
    color: #0f172a !important;
    line-height: 1.6;
    min-height: 100vh;
    overscroll-behavior-y: none; /* e questa */
}

/* Splash Screen */
.splash-screen
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.logo {
    margin-bottom: 30px;
}

.logo-image {
    width: 250px;
    height: auto;
    animation: fadeInScale 0.8s ease-out;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

/* Steps */
.step {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.step.active {
    display: block;
}

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

/* Step Header */
.step-header {
    margin-bottom: 30px;
}

.progress {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
}

.btn-back {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-back:hover {
    color: var(--primary-color);
}

.btn-nav {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

.btn-nav:hover {
    background: var(--background);
}

/* Typography */
h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 30px;
}

/* Welcome Page */
.welcome-content {
    text-align: center;
    padding: 60px 20px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.feature {
    text-align: center;
}

.feature .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.feature h3 {
    font-size: 18px;
    color: var(--text-primary);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-icon
{
    /*    font-size: 36px;*/
    margin-bottom: 12px;
    text-align: center;
}

.card-title
{
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.doctor-card {
    display: flex;
    gap: 16px;
    align-items: start;
}

.doctor-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.doctor-info {
    flex: 1;
}

.doctor-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.doctor-specialty {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.doctor-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.doctor-rating span {
    color: #fbbf24;
}

/* Doctor Detail Page */
.doctor-detail-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.doctor-detail-header {
    display: flex;
    gap: 24px;
    align-items: start;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.doctor-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    flex-shrink: 0;
}

.doctor-detail-info {
    flex: 1;
}

.doctor-detail-info h2 {
    margin-bottom: 8px;
}

.doctor-detail-section {
    margin-bottom: 30px;
}

.doctor-detail-section:last-of-type {
    margin-bottom: 40px;
}

.specializations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.specialization-tag {
    background: #eff6ff;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #bfdbfe;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 12px;
}

.info-item {
    display: flex;
    gap: 12px;
    align-items: start;
}

.info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.info-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.doctor-bio {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 12px;
}

/* Calendar */
.calendar-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.calendar-day.header {
    color: var(--text-secondary);
    font-weight: 600;
    cursor: default;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.available {
    background: var(--background);
    border: 1px solid var(--border-color);
}

.calendar-day.available:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.calendar-day.disabled {
    color: var(--text-secondary);
    opacity: 0.4;
    cursor: not-allowed;
}

/* Time Slots */
.time-slots-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.time-slots-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.time-slots {
    margin-top: 16px;
}

.time-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    margin-top: 8px;
}

.time-separator {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.time-slot {
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s;
}

.time-slot:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.time-slot.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Patient Form */
.booking-summary {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.patient-form {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: start;
    gap: 12px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    line-height: 1.5;
}

/* Confirmation */
.confirmation-content {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 30px;
}

.confirmation-details {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin: 40px 0;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.doctor-detail-section.selected
{
    border: 1px solid #2563eb;
    padding: 10px;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 24px;
    }

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

    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        font-size: 12px;
    }

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

.locations-wrapper
{
    margin-top: 24px;
}

.locations-title
{
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.locations-subtitle
{
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

.location-error
{
    display: none;
    color: #d32f2f;
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.locations-list
{
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.location-card
{
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    transition: all .2s ease;
}

    .location-card:hover
    {
        border-color: #2b7cff;
        transform: translateY(-1px);
    }

    .location-card.selected
    {
        border-color: #2b7cff;
        background: #d7fdbf; /*#f4f8ff;*/
        box-shadow: 0 0 0 4px rgba(43,124,255,.12);
    }

.location-card-icon
{
    font-size: 28px;
}

.location-card-content
{
    flex: 1;
}

.location-card-name
{
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.location-card-address
{
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.location-card-check
{
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2b7cff;
    color: white;
    font-weight: bold;
    opacity: 0;
    transform: scale(.7);
    transition: all .2s ease;
}

.location-card.selected .location-card-check
{
    opacity: 1;
    transform: scale(1);
}


/* Nuove classi installazione APP */
#install-app-banner
{
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba( 0, 0, 0, .12 );
    padding: 14px;
    width: 300px;
    animation: installFade .3s ease;
}

.install-content
{
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-icon
{
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f4f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.install-text
{
    flex: 1;
}

.install-title
{
    font-size: 15px;
    font-weight: 700;
}

.install-subtitle
{
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

#install-btn
{
    border: none;
    background: #0066ff;
    color: white;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

#close-install
{
    cursor: pointer;
    color: #999;
    margin-left: 8px;
}

@keyframes installFade
{

    from
    {
        opacity: 0;
        transform: translateY(-15px);
    }

    to
    {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-card-name
{
    font-size: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
    font-weight: 400;
}

.location-name
{
    font-style: italic;
    font-weight: 600;
}

.location-city
{
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    color: #1f1f1f;
}
