/* =============================================================================
   ecommerce-account.css — Pass D3 / Task 2
   Stile area cliente frontend: login, registrazione, reset, dashboard, profilo,
   storico ordini. Coerente con ecommerce-checkout.css (classi "co-*"), ma con
   prefisso "acc-" per evitare collisioni e permettere divergere in futuro.
   ============================================================================= */

.acc-root {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ─── Pagine pubbliche auth (login/register/reset): card centrata ─── */
.acc-auth-wrap {
    max-width: 460px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}
.acc-auth-wrap.wide { max-width: 620px; }

.acc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
    margin-bottom: 1.25rem;
}
.acc-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 .25rem 0;
    color: #111827;
}
.acc-card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #111827;
    padding-bottom: .5rem;
    border-bottom: 1px solid #f3f4f6;
}
.acc-card .lead {
    color: #6b7280;
    font-size: .9rem;
    margin: 0 0 1.25rem 0;
}

/* ─── Form fields ─── */
.acc-field { margin-bottom: 1rem; }
.acc-field label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .35rem;
}
.acc-field .req { color: #dc2626; }
.acc-field input[type="text"],
.acc-field input[type="email"],
.acc-field input[type="password"],
.acc-field input[type="tel"],
.acc-field input[type="date"],
.acc-field select,
.acc-field textarea {
    width: 100%;
    padding: .65rem .85rem;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font-size: .95rem;
    transition: border-color .12s, box-shadow .12s;
    background: #fff;
    font-family: inherit;
}
.acc-field input:focus,
.acc-field select:focus,
.acc-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.acc-field .hint {
    font-size: .78rem;
    color: #6b7280;
    margin: .25rem 0 0 0;
}
.acc-field .err {
    font-size: .78rem;
    color: #dc2626;
    margin: .25rem 0 0 0;
}

/* Grid responsive per coppie di campi (nome/cognome, ...) */
.acc-grid {
    display: grid;
    gap: 1rem;
}
.acc-grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
    .acc-grid-2 { grid-template-columns: 1fr; }
}

/* ─── Checkbox GDPR ─── */
.acc-check {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .86rem;
    color: #374151;
    margin: .65rem 0;
    cursor: pointer;
    line-height: 1.45;
}
.acc-check input[type="checkbox"] {
    margin-top: .2rem;
    flex-shrink: 0;
    accent-color: #2563eb;
}

/* ─── Bottoni ─── */
.acc-btn {
    display: inline-block;
    padding: .75rem 1.25rem;
    background: #111827;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, transform .04s;
    text-align: center;
}
.acc-btn:hover { background: #1f2937; }
.acc-btn:active { transform: translateY(1px); }
.acc-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.acc-btn.block { width: 100%; }
.acc-btn.ghost {
    background: transparent;
    color: #111827;
    border: 1px solid #d1d5db;
}
.acc-btn.ghost:hover { background: #f9fafb; }
.acc-btn.danger {
    background: #dc2626;
}
.acc-btn.danger:hover { background: #b91c1c; }
.acc-btn.small { padding: .4rem .75rem; font-size: .82rem; }

/* ─── Link helper sotto i form auth ─── */
.acc-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}
.acc-links a { color: #2563eb; text-decoration: none; }
.acc-links a:hover { text-decoration: underline; }

/* ─── Alert / flash ─── */
.acc-alert {
    padding: .8rem 1rem;
    border-radius: 7px;
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid transparent;
}
.acc-alert.info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.acc-alert.success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.acc-alert.warn, .acc-alert.warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.acc-alert.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* =============================================================================
   AREA RISERVATA (dashboard / ordini / profilo) — 2 colonne con sidebar
   ============================================================================= */
.acc-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}
@media (max-width: 840px) {
    .acc-layout { grid-template-columns: 1fr; }
}

.acc-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 1rem;
}
.acc-sidebar .user-box {
    padding: .75rem 0 1rem 0;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: .75rem;
}
.acc-sidebar .user-box .name {
    font-weight: 700;
    color: #111827;
    font-size: .95rem;
}
.acc-sidebar .user-box .email {
    color: #6b7280;
    font-size: .8rem;
    word-break: break-all;
}
.acc-sidebar nav a {
    display: block;
    padding: .55rem .75rem;
    color: #374151;
    text-decoration: none;
    font-size: .92rem;
    border-radius: 6px;
    transition: background .1s;
}
.acc-sidebar nav a:hover { background: #f3f4f6; }
.acc-sidebar nav a.active {
    background: #111827;
    color: #fff;
    font-weight: 600;
}
.acc-sidebar nav .sep {
    height: 1px;
    background: #f3f4f6;
    margin: .5rem 0;
}

.acc-main {
    min-width: 0; /* evita overflow su grid */
}
.acc-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.25rem 0;
}

/* ─── Stat boxes (dashboard) ─── */
.acc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
    .acc-stats { grid-template-columns: 1fr; }
}
.acc-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.2rem;
}
.acc-stat .label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: .35rem;
}
.acc-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
}
.acc-stat .sub {
    font-size: .78rem;
    color: #9ca3af;
    margin-top: .25rem;
}

/* ─── Tabella ordini ─── */
.acc-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.acc-table thead th {
    background: #f9fafb;
    padding: .75rem 1rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.acc-table tbody td {
    padding: .85rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: .9rem;
    color: #374151;
}
.acc-table tbody tr:last-child td { border-bottom: none; }
.acc-table tbody tr:hover { background: #fafbfc; }
.acc-table .num {
    font-family: Menlo, Consolas, monospace;
    font-size: .85rem;
    color: #111827;
    font-weight: 600;
}
.acc-table .tot { text-align: right; font-weight: 600; }
.acc-table a { color: #2563eb; text-decoration: none; }
.acc-table a:hover { text-decoration: underline; }

/* Badge stati ordine */
.acc-badge {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.acc-badge.nuovo        { background: #dbeafe; color: #1e40af; }
.acc-badge.pagato,
.acc-badge.confermato   { background: #d1fae5; color: #065f46; }
.acc-badge.spedito      { background: #ede9fe; color: #5b21b6; }
.acc-badge.consegnato   { background: #d1fae5; color: #065f46; }
.acc-badge.annullato    { background: #fee2e2; color: #991b1b; }
.acc-badge.in_attesa,
.acc-badge.in-attesa,
.acc-badge.pending      { background: #fef3c7; color: #92400e; }

/* ─── Empty state ─── */
.acc-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    background: #fff;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #6b7280;
}
.acc-empty h3 {
    color: #111827;
    margin: 0 0 .5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ─── Banner verifica email ─── */
.acc-verify-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: .85rem 1rem;
    border-radius: 8px;
    font-size: .88rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.acc-verify-banner::before { content: "✉"; font-size: 1.1rem; }

/* ─── Lista compatta ultimi accessi ─── */
.acc-loglist {
    font-size: .82rem;
    color: #374151;
    list-style: none;
    padding: 0;
    margin: 0;
}
.acc-loglist li {
    padding: .5rem 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.acc-loglist li:last-child { border-bottom: none; }
.acc-loglist .esito.riuscito { color: #065f46; font-weight: 600; }
.acc-loglist .esito.fallito  { color: #991b1b; font-weight: 600; }
.acc-loglist .meta           { color: #9ca3af; font-size: .76rem; }

/* Divider bottom CTA ─── */
.acc-divider {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Box pericoloso (eliminazione account) */
.acc-danger-zone {
    border: 1px solid #fecaca;
    background: #fef2f2;
    border-radius: 10px;
    padding: 1.25rem;
}
.acc-danger-zone h2 {
    color: #991b1b;
    border-color: #fecaca;
}
.acc-danger-zone p {
    color: #7f1d1d;
    font-size: .88rem;
    margin: 0 0 1rem 0;
}
