/* S103 G16 — Account cliente PWA pubblico */

.acc-container {
    max-width: 480px;
    margin: 30px auto;
    padding: 0 16px;
}
.acc-container-wide {
    max-width: 760px;
}

.acc-card {
    background: #fff;
    border-radius: 8px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.acc-card h1 {
    margin: 0 0 4px;
    font-size: 24px;
    color: #333;
}
.acc-sub {
    color: #777;
    margin: 0 0 20px;
    font-size: 14px;
}

.acc-form { margin-top: 8px; }
.acc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.acc-form-field {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}
.acc-form-field label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #444;
}
.acc-form-field label small {
    font-weight: normal;
    color: #888;
    font-size: 11px;
}
.acc-form-field input[type="text"],
.acc-form-field input[type="email"],
.acc-form-field input[type="tel"],
.acc-form-field input[type="password"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color .15s;
}
.acc-form-field input:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}

.acc-form-actions {
    margin-top: 20px;
}
.acc-btn {
    padding: 11px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: background .15s;
    text-decoration: none;
    display: inline-block;
}
.acc-btn-primary {
    background: #f5a623;
    color: #fff;
    width: 100%;
}
.acc-btn-primary:hover { background: #d68a0d; }
.acc-btn-secondary {
    background: #fff;
    color: #555;
    border: 1px solid #ccc;
}
.acc-btn-secondary:hover { background: #f5f5f5; }
.acc-btn-danger {
    background: #fef5f5;
    color: #c63131;
    border: 1px solid #f5c6cb;
    padding: 6px 12px;
    font-size: 13px;
}
.acc-btn-danger:hover { background: #f5c6cb; }

.acc-link-row {
    text-align: center;
    margin: 16px 0 0;
    color: #666;
    font-size: 14px;
}
.acc-link-row a {
    color: #f5a623;
    text-decoration: none;
    font-weight: 600;
}

.acc-alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.acc-alert-error {
    background: #fef5f5;
    border-left: 3px solid #c63131;
    color: #721c24;
}
.acc-alert-ok {
    background: #f1faf1;
    border-left: 3px solid #2a7a2e;
    color: #155724;
}

/* PROFILO */
.acc-profilo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}
.acc-profilo-header h1 { margin: 0; font-size: 22px; }
.acc-profilo-header .d-inline { display: inline; }

.acc-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}
.acc-stat {
    background: #fff;
    padding: 16px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.acc-stat-label { font-size: 12px; color: #888; text-transform: uppercase; }
.acc-stat-value { font-size: 24px; font-weight: 700; color: #f5a623; margin-top: 4px; }

.acc-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.acc-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #333;
}
.acc-empty {
    color: #888;
    font-style: italic;
    padding: 16px 0;
    text-align: center;
}
.acc-empty a { color: #f5a623; font-weight: 600; }

/* Indirizzi */
.acc-indirizzi-list,
.acc-storico-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.acc-indirizzo-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.acc-indirizzo-item:last-child { border-bottom: 0; }
.acc-indirizzo-info { flex: 1; }
.acc-indirizzo-info small { color: #888; font-size: 12px; display: block; margin-top: 2px; }
.acc-badge-default {
    background: #fffaf0;
    color: #b06a00;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 6px;
    font-weight: 600;
}

/* Storico ordini */
.acc-storico-item {
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}
.acc-storico-item:last-child { border-bottom: 0; }
.acc-ord-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.acc-ord-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.acc-ord-meta strong { color: #333; }
.acc-ord-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.acc-stars { color: #f5a623; font-size: 14px; letter-spacing: 1px; }
.acc-link {
    color: #f5a623;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.acc-link-rev {
    background: #f5a623;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.acc-link-rev:hover { background: #d68a0d; }

.acc-badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    background: #e0e0e0;
    color: #555;
}

.acc-form-details {
    margin-top: 16px;
    padding: 12px 0;
    border-top: 1px solid #eee;
}
.acc-form-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #f5a623;
    padding: 6px 0;
}
.acc-form-details[open] summary { margin-bottom: 12px; }

@media (max-width: 600px) {
    .acc-form-row { grid-template-columns: 1fr; }
    .acc-stats-grid { grid-template-columns: 1fr; }
    .acc-profilo-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .acc-indirizzo-item { flex-direction: column; }
    .acc-ord-meta { flex-direction: column; gap: 4px; }
}

/* S104 — Nav cliente + preferiti grid + ricorrenti */

.acc-nav {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}
.acc-nav a {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 3px solid transparent;
    transition: all .15s;
    min-width: 90px;
}
.acc-nav a:hover { background: #fafafa; color: #f5a623; }
.acc-nav a.active {
    color: #f5a623;
    border-bottom-color: #f5a623;
    background: #fffaf0;
}

.acc-btn-inline { width: auto; }

/* G18 — Preferiti grid */
.acc-piatti-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.acc-piatto-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow .15s;
}
.acc-piatto-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.acc-piatto-foto {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
}
.acc-piatto-foto-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
    background: #fafafa;
}
.acc-piatto-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.acc-piatto-info strong { color: #333; font-size: 15px; }
.acc-piatto-info small { color: #777; font-size: 12px; line-height: 1.4; }
.acc-piatto-prezzo {
    margin-top: auto;
    color: #f5a623;
    font-weight: 700;
    font-size: 16px;
}
.acc-btn-pref-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform .15s;
}
.acc-btn-pref-toggle:hover { transform: scale(1.15); }
.acc-btn-pref-on { background: #fff; }
.acc-btn-pref-off { background: rgba(255,255,255,0.85); }

/* G12+G13 — Ricorrenti */
.acc-ricorrente-card {
    background: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid #2a7a2e;
}
.acc-ric-pausa {
    border-left-color: #999;
    opacity: 0.75;
}
.acc-ric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}
.acc-ric-header strong { font-size: 16px; color: #333; }
.acc-ric-when {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}
.acc-ric-attivo {
    background: #d4edda;
    color: #155724;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.acc-ric-sospeso {
    background: #e0e0e0;
    color: #666;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.acc-ric-info {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}
.acc-ric-piatti {
    margin: 12px 0 8px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.acc-ric-piatti ul {
    list-style: none;
    padding-left: 16px;
    margin: 6px 0 0;
}
.acc-ric-piatti li {
    font-size: 13px;
    color: #555;
    padding: 2px 0;
}
.acc-ric-piatti li::before {
    content: "•";
    color: #f5a623;
    margin-right: 6px;
}
.acc-ric-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.acc-ric-actions .acc-btn { width: auto; }

/* Form ricorrente: select piatti */
.acc-piatti-select {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}
.acc-piatti-select li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 10px;
}
.acc-piatti-select li label {
    flex: 1;
    font-size: 14px;
    margin: 0;
}
.acc-piatti-select li input[type="number"] {
    width: 70px;
    text-align: center;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.acc-btn-riordina {
    background: #2a7a2e;
}
.acc-btn-riordina:hover { background: #1f5d22; }

@media (max-width: 600px) {
    .acc-ric-header { flex-direction: column; }
    .acc-ric-actions { flex-direction: column; }
    .acc-ric-actions .acc-btn { width: 100%; }
    .acc-nav { flex-direction: column; }
    .acc-nav a { border-bottom: 1px solid #eee; border-left: 3px solid transparent; }
    .acc-nav a.active { border-bottom-color: #eee; border-left-color: #f5a623; }
}

/* S105 G21+G34 — Movimenti loyalty */
.acc-movimenti-list { list-style: none; padding: 0; margin: 0; }
.acc-movimento {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.acc-movimento:last-child { border-bottom: 0; }
.acc-movimento small { display: block; color: #888; font-size: 12px; margin-top: 2px; }
.acc-mov-valore { font-weight: 700; font-size: 16px; white-space: nowrap; }
.acc-mov-ok { color: #2a7a2e; }
.acc-mov-neg { color: #c63131; }
