/* wwwroot/css/area-pazienti.css
   Area riservata pazienti — mobile-first: card grandi, un'azione primaria per
   schermata, bottom tab bar. Riusa i design token di studio-medico.css
   (--color-primary, --color-accent, --radius, ecc.).
   ------------------------------------------------------------------ */

.ap-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--color-bg, #f4f6fb);
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.ap-content {
    flex: 1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
    box-sizing: border-box;
}

.ap-loading {
    display: flex;
    justify-content: center;
    padding: 4rem 0;
    color: var(--color-accent, #1b6ec2);
}

.ap-header {
    margin-bottom: 1rem;
}

.ap-saluto {
    font-family: var(--font-head, inherit);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary, #052767);
}

.ap-titolo {
    font-family: var(--font-head, inherit);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-primary, #052767);
    margin-bottom: 1rem;
}

/* ── CARD ─────────────────────────────────────────────────────── */
.ap-card {
    background: var(--color-card-bg, #fff);
    border: 1px solid var(--color-border, #d8dde8);
    border-radius: var(--radius, 14px);
    box-shadow: var(--shadow, 0 2px 16px rgba(5,39,103,.1));
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.1rem;
}

.ap-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary, #052767);
    margin-bottom: .6rem;
}

/* ── SCELTA PAZIENTE (account condivisi) ──────────────────────── */
.ap-scelta-form { display: block; margin-bottom: 1.1rem; }

.ap-scelta-card {
    display: block;
    width: 100%;
    text-align: left;
    font-family: inherit;
    border: 2px solid var(--color-border, #d8dde8);
    cursor: pointer;
    margin-bottom: 0;
}

.ap-scelta-card:active { border-color: var(--color-accent, #1b6ec2); }

.ap-scelta-nome {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-primary, #052767);
}

.ap-scelta-meta {
    font-size: .85rem;
    color: var(--color-muted, #6b7490);
    margin-top: .2rem;
}

.ap-dato {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--color-border, #eef0f6);
    font-size: .98rem;
}

.ap-dato:last-of-type { border-bottom: none; }
.ap-dato span { color: var(--color-muted, #6b7490); }
.ap-dato strong { text-align: right; }

.ap-nota {
    font-size: .85rem;
    color: var(--color-muted, #6b7490);
    margin: .6rem 0 0;
}

.ap-meta {
    font-size: .82rem;
    color: var(--color-muted, #6b7490);
    margin: .2rem 0 .8rem;
}

.ap-vuoto {
    color: var(--color-muted, #6b7490);
    text-align: center;
    padding: 2rem 1rem;
}

/* ── APPUNTAMENTO ─────────────────────────────────────────────── */
.ap-appuntamento {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--color-border, #eef0f6);
    flex-wrap: wrap;
}

.ap-appuntamento:last-child { border-bottom: none; }

.ap-appuntamento-data {
    flex: none;
    width: 54px;
    text-align: center;
    background: var(--color-primary, #052767);
    color: #fff;
    border-radius: 10px;
    padding: .4rem 0;
}

.ap-giorno { font-size: 1.2rem; font-weight: 800; line-height: 1; }
.ap-mese { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }

.ap-appuntamento-info { flex: 1; min-width: 100px; }
.ap-appuntamento-ora { font-size: 1.05rem; font-weight: 700; }
.ap-appuntamento-motivo { font-size: .85rem; color: var(--color-muted, #6b7490); }

.ap-appuntamento-azione { flex: none; }

/* ── PULSANTI ─────────────────────────────────────────────────── */
.ap-btn-primario, .ap-btn-secondario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    padding: .75rem 1.2rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    min-height: 46px;
}

.ap-btn-primario {
    background: var(--color-accent, #1b6ec2);
    color: #fff;
}

.ap-btn-primario:disabled { opacity: .6; cursor: not-allowed; }

.ap-btn-secondario {
    background: #fff;
    color: var(--color-accent, #1b6ec2);
    border: 2px solid var(--color-accent, #1b6ec2);
}

.ap-btn-full { width: 100%; }

.ap-azioni {
    display: flex;
    gap: .75rem;
    margin-top: 1rem;
}

.ap-azioni .ap-btn-secondario, .ap-azioni .ap-btn-primario { flex: 1; }

.ap-btn-annulla {
    border: 1px solid var(--color-danger, #c0392b);
    background: #fff;
    color: var(--color-danger, #c0392b);
    border-radius: 8px;
    padding: .45rem .85rem;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 40px;
}

.ap-conferma-annullo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
}

.ap-btn-si, .ap-btn-no {
    border: none;
    border-radius: 8px;
    padding: .4rem .7rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 36px;
}

.ap-btn-si { background: var(--color-danger, #c0392b); color: #fff; }
.ap-btn-no { background: #eef0f6; color: var(--color-text, #1a1f2e); }

.ap-conferma-inline {
    color: var(--color-success, #1a7a4a);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── PRENOTAZIONE: GIORNI / SLOT ──────────────────────────────── */
.ap-giorno-box {
    background: var(--color-card-bg, #fff);
    border: 1px solid var(--color-border, #d8dde8);
    border-radius: var(--radius, 14px);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.ap-giorno-intestazione {
    font-weight: 700;
    color: var(--color-primary, #052767);
    text-transform: capitalize;
    margin-bottom: .7rem;
}

.ap-giorno-pieno {
    color: var(--color-muted, #6b7490);
    font-style: italic;
    font-size: .9rem;
}

.ap-slot-griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: .6rem;
}

.ap-slot-btn {
    background: #fff;
    border: 2px solid var(--color-accent, #1b6ec2);
    color: var(--color-accent, #1b6ec2);
    border-radius: 8px;
    padding: .65rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 46px;
}

.ap-slot-btn:active { transform: scale(.96); }

/* ── FORM ─────────────────────────────────────────────────────── */
.ap-label {
    display: block;
    font-weight: 600;
    font-size: .92rem;
    margin: .8rem 0 .3rem;
}

.ap-opz { font-weight: 400; color: var(--color-muted, #6b7490); font-size: .85rem; }

.ap-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-border, #d8dde8);
    border-radius: 8px;
    padding: .65rem .8rem;
    font-size: 1rem;
    font-family: inherit;
}

/* ── CONFERMA ─────────────────────────────────────────────────── */
.ap-conferma {
    text-align: center;
    padding: 2rem 1.2rem;
}

.ap-conferma-icon {
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 50%;
    background: var(--color-success, #1a7a4a);
    color: #fff;
    font-size: 1.6rem;
    margin: 0 auto 1rem;
}

.ap-conferma h2 { font-size: 1.2rem; margin-bottom: .5rem; }
.ap-conferma .ap-btn-primario { margin-top: 1.2rem; }

.ap-errore {
    background: #fdecea;
    color: var(--color-danger, #c0392b);
    border-radius: 8px;
    padding: .7rem .9rem;
    font-size: .9rem;
    margin-top: .8rem;
}

/* ── BOTTOM TAB BAR ───────────────────────────────────────────── */
.ap-tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--color-border, #d8dde8);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 50;
}

.ap-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: .55rem 0 .5rem;
    color: var(--color-muted, #6b7490);
    text-decoration: none;
    font-size: .72rem;
    font-weight: 600;
}

.ap-tab i { font-size: 1.25rem; }

.ap-tab.active { color: var(--color-accent, #1b6ec2); }

@media (min-width: 560px) {
    .ap-tabbar { max-width: 560px; left: 50%; transform: translateX(-50%); border-left: 1px solid var(--color-border, #d8dde8); border-right: 1px solid var(--color-border, #d8dde8); border-radius: 14px 14px 0 0; }
}
