:root {
    --primary: #F07A29;
    --primary-dark: #D96518;
    --secondary: #C80014;
    --accent: #F3CC3A;
    --background: #F2F2F2;
    --dark: #1f1f29;
    --light: #f7f7fb;
    --white: #ffffff;
    --gray: #777;
    --border: #e6e6ef;
    --success: #15803d;
    --danger: #b91c1c;
    --radius: 18px;
}

* {
    box-sizing: border-box;
    font-family: "Montserrat", sans-serif;
}

.badge-vinto {

    background: #dcfce7;

    color: #15803d;

}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    min-height: 76vh;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 16px 40px rgba(31, 31, 41, 0.08);
    margin-bottom: 24px;
}

.hero-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: 0;
}

.hero-card h1,
.hero-card h2 {
    margin-top: 0;
}

h1, h2, h3 {
    line-height: 1.15;
}

h1 {
    font-size: clamp(30px, 5vw, 48px);
    margin: 0 0 12px;
}

h2 {
    font-size: 24px;
    margin: 0 0 18px;
}

p {
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(230, 0, 126, 0.16);
    border-color: var(--primary);
}

.checkbox-label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 500;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

/* Accordion buoni dashboard */
.coupon-accordion {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.coupon-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(31, 31, 41, 0.04);
}

.coupon-toggle {
    width: 100%;
    border: 0;
    background: #fff !important;
    color: var(--dark) !important;
    border-radius: 0;
    padding: 18px 20px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    text-align: left;
    font: inherit;
    box-shadow: none;
}

.coupon-toggle:hover {
    background: #f8f8fa !important;
    text-decoration: none;
}

.coupon-toggle strong {
    font-size: 18px;
}

.coupon-toggle span:nth-child(2) {
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}

.coupon-content {
    display: none;
    padding: 20px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.coupon-content.is-open {
    display: block;
}

.coupon-code {
    margin: 8px 0 14px;
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    word-break: break-word;
}

.badge-assegnato {
    background: #fee2e2;
    color: #c80014;
}

.badge-utilizzato {
    background: #dcfce7;
    color: #15803d;
}

@media (max-width: 768px) {
    .coupon-toggle {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .coupon-toggle span:nth-child(2) {
        font-size: 16px;
    }
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    margin:3px 3px 3px 0;
    background: var(--primary);
    color: white;
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover,
button:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-secondary {
    background: var(--dark);
}

.btn-secondary:hover {
    background: #000;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 700;
}

.alert-error {
    background: #fee2e2;
    color: var(--danger);
}

.alert-success {
    background: #dcfce7;
    color: var(--success);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
}

.stat strong {
    display: block;
    font-size: 28px;
    color: var(--primary);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 800;
    background: var(--light);
}

.badge-disponibile {
    background: #FEF3C7;
    color: #B45309;
}

.badge-assegnato {
    background: #FEE2E2;
    color: #C80014;
}

.badge-utilizzato {
    background: #DCFCE7;
    color: #15803D;
}

.site-footer {
    text-align: center;
    color: var(--gray);
    padding: 30px 20px;
    font-size: 14px;
}

@media (max-width: 760px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: row;
    }

    .form-grid
     {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .card {
        padding: 18px;
    }
}
.coupon-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.coupon-card {
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 20px;
    background: #fff;
}

.coupon-shop {
    font-weight: 900;
    color: var(--secondary);
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: .04em;
}

.coupon-code {
    margin: 12px 0;
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    word-break: break-word;
}

.coupon-value {
    font-size: 22px;
    font-weight: 900;
}

@media (max-width: 900px) {
    .coupon-grid {
        grid-template-columns: 1fr;
    }
}
.scanner-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(31, 31, 41, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.scanner-modal {
    width: min(520px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}

.scanner-reader {
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.scanner-reader video {
    border-radius: 16px;
}
.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: #1f1f29;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .header-inner {
        position: relative;
    }

    .menu-toggle {
        display: flex;
        margin-left: auto;
    }

    .nav {
        display: none;
        position: absolute;
        top: calc(100% + 14px);
        left: 0;
        right: 0;
        z-index: 9999;
        background: #ffffff;
        border-radius: 18px;
        padding: 16px;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        gap: 8px;
    }

    .nav.is-open {
        display: flex;
    }

    .nav a {
        display: block;
        padding: 12px 14px;
        border-radius: 12px;
        text-align: center;
    }
}