/* ========================================
   FORM TURISMO - Marchio Turistico Oliena
   ======================================== */

/* Reset e Base */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary: #1E3A6E;
    --primary-light: #2D5494;
    --primary-dark: #132848;
    --accent: #c9a227;
    --accent-light: #d4b84a;
    --warm: #8b7355;
    --warm-light: #a08b70;
    --success: #3d7a52;
    --error: #c45c5c;
    --error-light: #d47a7a;
    --warning: #c9a227;
    --cream: #f6f8fc;
    --cream-dark: #eef2f8;
    --beige: #dce4f0;
    --beige-dark: #c8d4e8;
    --brown-light: #c4b5a5;
    --brown: #8b7355;
    --brown-dark: #6b5a45;
    --text: #1a2a4a;
    --text-light: #4a5a7a;
    --text-muted: #7a8a9a;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow: 0 2px 8px rgba(19, 40, 72, 0.08);
    --shadow-lg: 0 4px 16px rgba(19, 40, 72, 0.1);
    --shadow-xl: 0 8px 30px rgba(19, 40, 72, 0.12);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--cream);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}

/* Header */
.header {
    text-align: center;
    padding: 45px 20px 40px;
    min-height: 176px;
    background:
        url('../loghi-oliena/fondo-barra.png') center center / auto no-repeat,
        linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-sizing: border-box;
}

.header h1 {
    margin: 0 0 10px 0;
    font-size: 2.05rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header p {
    margin: 0;
    opacity: 0.92;
    font-size: 1.4rem;
    font-weight: 400;
}

/* Progress Bar */
.progress-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--beige);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: var(--beige);
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.progress-step .step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--beige-dark);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-step .step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s;
}

.progress-step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: var(--success);
}

/* Form Card */
.form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    border: 1px solid var(--beige);
}

.form-card h2 {
    margin: 0 0 6px 0;
    color: var(--brown-dark);
    font-size: 1.4rem;
    font-weight: 600;
}

.step-intro {
    background: var(--cream-dark);
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 26px;
    font-size: 0.92rem;
    color: var(--text-light);
    border-left: 3px solid var(--primary);
}

.step-intro strong {
    color: var(--primary-dark);
}

/* Form Elements */
.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.88rem;
}

.form-group label .required {
    color: var(--error);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--beige-dark);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
    color: var(--text);
}

.form-control:hover {
    border-color: var(--brown-light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 110, 0.12);
}

.form-control.error {
    border-color: var(--error);
    background: #fef8f8;
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 42px;
    cursor: pointer;
}

/* Field Hint */
.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
    display: block;
}

/* Privacy Notice */
.privacy-notice {
    background: var(--cream);
    border: 1px solid var(--beige);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 22px;
}

.privacy-notice h3 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: var(--brown-dark);
}

.privacy-notice > p {
    margin: 0 0 10px 0;
    font-size: 0.88rem;
    color: var(--text-light);
}

.privacy-toggle {
    margin-bottom: 4px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.privacy-text {
    margin-top: 14px;
    padding: 18px;
    background: white;
    border: 1px solid var(--beige);
    border-radius: var(--radius);
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--text-light);
    max-height: 400px;
    overflow-y: auto;
}

.privacy-text p {
    margin: 0 0 12px 0;
}

.privacy-text ul {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.privacy-text li {
    margin-bottom: 4px;
}

.privacy-text strong {
    color: var(--text);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    background: var(--cream);
    border-radius: var(--radius);
    border: 1px solid var(--beige);
    transition: all 0.2s;
}

.checkbox-group:hover {
    background: var(--cream-dark);
    border-color: var(--beige-dark);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Error Message */
.error-message {
    color: var(--error);
    font-size: 0.78rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Form Row (2 colonne) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 26px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--cream-dark);
    color: var(--text);
    border: 1px solid var(--beige-dark);
}

.btn-secondary:hover {
    background: var(--beige);
    border-color: var(--brown-light);
}

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

.btn-success:hover {
    background: #2e6040;
    box-shadow: var(--shadow);
}

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

.btn-danger:hover {
    background: #b04a4a;
}

.btn-outline {
    background: transparent;
    border: 2px solid #6b7280;
    color: #6b7280;
}

.btn-outline:hover {
    background: #6b7280;
    color: white;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-sm {
    padding: 9px 16px;
    font-size: 0.85rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--beige);
}

.form-actions .btn {
    min-width: 145px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--beige-dark);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: var(--cream);
}

.upload-area:hover {
    border-color: var(--primary-light);
    background: var(--cream-dark);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(30, 58, 110, 0.08);
}

.upload-area.error {
    border-color: var(--error);
    background: #fef8f8;
}

.upload-area .upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.8;
}

.upload-area p {
    margin: 0 0 6px 0;
    color: var(--text);
    font-size: 1rem;
}

.upload-area .upload-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.upload-area input[type="file"] {
    display: none;
}

/* Photo Preview */
.photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.photo-preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--beige);
    box-shadow: var(--shadow);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s;
}

.photo-preview:hover img {
    transform: scale(1.03);
}

.photo-preview .remove-photo {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0;
}

.photo-preview:hover .remove-photo {
    opacity: 1;
}

.photo-preview .remove-photo:hover {
    background: var(--error);
}

.photo-preview .photo-order {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    color: white;
    padding: 18px 8px 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Photo Status */
.photo-status {
    font-weight: 600;
    padding: 10px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
}

.photo-status.incomplete {
    background: #fef6e6;
    color: #8a6d20;
}

.photo-status.complete {
    background: #eef6ee;
    color: #4a6b4a;
}

.photo-warning {
    color: var(--error);
    font-weight: 600;
}

.photo-ok {
    color: var(--success);
}

.photo-alert {
    font-weight: 500;
    text-align: center;
}

/* Banner caricamento foto in corso */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 58, 110, 0.08);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 14px;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 500;
}

.upload-progress-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary-dark);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Photo Counter (modifica.php) */
.photo-counter {
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--cream-dark);
    border: 1px solid var(--beige);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.photo-counter.photo-ok {
    background: #eef6ee;
    border-color: var(--success);
    color: var(--success);
}

.photo-counter.photo-error {
    background: #fef2f2;
    border-color: var(--error);
    color: var(--error);
}

.photo-counter strong {
    font-size: 1.1rem;
}

/* Photo Deleted Animation */
.photo-preview.photo-deleted {
    opacity: 0.3;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.photo-preview.photo-deleted::after {
    content: "Eliminata";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(196, 92, 92, 0.9);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* New Photo Indicator */
.photo-preview.new-photo .photo-order {
    background: linear-gradient(transparent, rgba(30, 58, 110, 0.8));
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Dynamic Fields */
.dynamic-fields {
    display: none;
}

.dynamic-fields.active {
    display: block;
}

.dynamic-fields h3 {
    font-size: 0.95rem;
    color: var(--primary-dark);
    margin: 22px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--beige);
}

/* Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

/* Prodotto Card */
.prodotto-card {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 18px;
    margin: 18px 0;
    border: 1px solid var(--beige);
}

.prodotto-card h3 {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    color: var(--primary-dark);
}

/* Riepilogo */
.riepilogo-section {
    margin-bottom: 26px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--beige);
}

.riepilogo-section:last-child {
    border-bottom: none;
}

.riepilogo-section h3 {
    margin: 0 0 16px 0;
    font-size: 1.05rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.riepilogo-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.riepilogo-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--cream-dark);
}

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

.riepilogo-label {
    flex: 0 0 40%;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.riepilogo-value {
    flex: 1;
    color: var(--text);
}

.riepilogo-photos {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.riepilogo-photos img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.riepilogo-photos img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

/* Alert Messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 22px;
    font-weight: 500;
    font-size: 0.92rem;
}

.alert-success {
    background: #eef6ee;
    color: #3d5a3d;
    border: 1px solid #c5dcc5;
}

.alert-error {
    background: #fef5f5;
    color: #8b3a3a;
    border: 1px solid #e8c5c5;
}

.alert-warning {
    background: #fef9ed;
    color: #7a5d1a;
    border: 1px solid #e5d5a8;
}

.alert-info {
    background: #eef2f8;
    color: #1E3A6E;
    border: 1px solid #b5c8e8;
}

/* Char Counter */
.char-counter {
    display: block;
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 500;
}

.char-counter.warning {
    color: var(--warning);
}

.char-counter.limit {
    color: var(--error);
    font-weight: 600;
}

/* Admin Table */
/* Container allargato per admin */
.container--admin {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--beige);
}

.admin-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    background: white;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--beige);
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--cream-dark);
    font-weight: 600;
    color: var(--text);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.admin-table tr {
    transition: background 0.15s;
}

.admin-table tr:hover {
    background: var(--cream);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

/* Action icons per tabella admin */
.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.action-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.action-icon:hover {
    opacity: 1;
    background: var(--cream-dark);
}

.action-icon-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}

.action-icon-delete:hover {
    background: #fee2e2;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 70px auto;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--beige);
}

.login-card h1 {
    margin: 0 0 32px 0;
    text-align: center;
    color: var(--brown-dark);
    font-size: 1.5rem;
}

/* Dettaglio Operatore */
.detail-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 26px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--beige);
}

.detail-section h2 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    color: var(--brown-dark);
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

@media (max-width: 600px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    padding: 12px;
    background: var(--cream);
    border-radius: var(--radius);
}

.detail-item label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

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

.detail-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.detail-photos img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: var(--shadow);
}

.detail-photos img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Guida / Welcome Screen */
.welcome-screen .form-card {
    padding: 36px;
}

.welcome-screen h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.guida-lead {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    text-align: center;
    max-width: 580px;
    margin: 0 auto 8px;
}

.guida-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--beige);
}

.guida-section:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
    padding-bottom: 0;
}

.guida-section h3 {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guida-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

.guida-section p {
    font-size: 0.92rem;
    color: var(--text-light);
    margin: 0 0 10px;
    line-height: 1.65;
}

.guida-list,
.guida-steps {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.guida-list li,
.guida-steps li {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    padding: 8px 12px 8px 30px;
    position: relative;
    background: var(--cream);
    border-radius: var(--radius);
    margin-bottom: 6px;
}

.guida-list li::before {
    content: '\2713';
    position: absolute;
    left: 10px;
    top: 8px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.guida-list-prep li::before {
    content: '\25B8';
    color: var(--accent);
}

.guida-steps {
    counter-reset: step-counter;
}

.guida-steps li {
    counter-increment: step-counter;
    padding-left: 36px;
}

.guida-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 8px;
    top: 8px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guida-help {
    background: var(--cream);
    border: 1px solid var(--beige);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.guida-help h3::before {
    display: none;
}

.guida-nota {
    background: var(--cream);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    margin-top: 16px;
    color: var(--text-light);
    font-size: 0.92rem;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(40, 35, 30, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0.8;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    padding: 20px;
    transition: all 0.2s;
    user-select: none;
    opacity: 0.8;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Mappa */
.map-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.map-search-container input {
    flex: 1;
}

.map-search-container .btn {
    white-space: nowrap;
}

#map-geolocate-btn {
    padding: 10px 12px;
    font-size: 1rem;
}

.location-map {
    height: 260px;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--beige-dark);
    margin-bottom: 8px;
    z-index: 1;
}

.map-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 10px 0;
    text-align: center;
}

.coordinates-display input {
    background: var(--cream);
    cursor: not-allowed;
}

.map-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--beige-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.map-search-results.active {
    display: block;
}

.map-search-result-item {
    padding: 11px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--cream-dark);
    font-size: 0.88rem;
    transition: background 0.15s;
}

.map-search-result-item:last-child {
    border-bottom: none;
}

.map-search-result-item:hover {
    background: var(--cream);
}

.map-search-wrapper {
    position: relative;
    flex: 1;
}

.map-search-loading {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border: 2px solid var(--beige);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

.map-search-loading.active {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

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

    .header {
        padding: 35px 18px 32px;
    }


    .header h1 {
        font-size: 1.65rem;
    }

    .header p {
        font-size: 1.15rem;
    }

    .form-card {
        padding: 24px 18px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .progress-step .step-label {
        display: none;
    }

    .progress-step .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }

    .map-search-container {
        flex-wrap: wrap;
    }

    .map-search-container input {
        width: 100%;
    }

    .location-map {
        height: 220px;
    }

    .riepilogo-label {
        flex: 0 0 45%;
    }

    /* Tabella admin → schede su mobile */
    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--beige);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
    }

    .admin-table tr:last-child td {
        border-bottom: 1px solid var(--beige);
    }

    .admin-table tr:last-child td:last-child {
        border-bottom: none;
    }

    .admin-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
        border-bottom: 1px solid var(--beige);
        gap: 12px;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        color: var(--text-light);
        flex-shrink: 0;
        min-width: 110px;
    }

    .admin-table td.actions-cell {
        justify-content: flex-end;
        gap: 4px;
    }

    .admin-table td.actions-cell::before {
        margin-right: auto;
    }
}

