/* Global Styles */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
    color: #111827;
    line-height: 1.5;
    overflow-x: hidden;
    margin: 0;
}

:root {
    --brand-green: #00C853;
    --brand-green-hover: #00a844;
    --blue-600: #2563eb;
    --gray-50: #f9fafb;
    --gray-200: #e5e7eb;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* Layout Container */
body > header > div,
body > main > article,
body > footer > div {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

@media (min-width: 640px) { body > header > div, body > main > article, body > footer > div { max-width: 640px; } }
@media (min-width: 768px) { body > header > div, body > main > article, body > footer > div { max-width: 768px; } }
@media (min-width: 1024px) { body > header > div, body > main > article, body > footer > div { max-width: 1024px; } }
@media (min-width: 1280px) { body > header > div, body > main > article, body > footer > div { max-width: 1280px; } }

/* Header */
header {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

header > div {
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header Left: Logo & Nav */
header > div > div:first-child {
    display: flex;
    align-items: center;
    column-gap: 2rem;
}

/* Logo */
header > div > div:first-child > a {
    display: flex;
    align-items: center;
    column-gap: 0.5rem;
    text-decoration: none;
}

header > div > div:first-child > a > div {
    background-color: var(--brand-green);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 1.25rem;
    font-style: italic;
}

header > div > div:first-child > a > span {
    color: var(--blue-600);
    font-weight: 700;
    font-size: 1.25rem;
}

/* Nav */
header nav {
    display: none;
}

@media (min-width: 768px) {
    header nav {
        display: flex;
        column-gap: 1.5rem;
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--gray-600);
    }
}

header nav a {
    text-decoration: none;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

header nav a:hover {
    color: var(--brand-green);
    border-bottom-color: var(--brand-green);
}

/* Header Right: Actions */
header > div > div:last-child {
    display: flex;
    align-items: center;
    column-gap: 0.75rem;
}

/* Lang Selector */
header > div > div:last-child > div {
    display: none;
    align-items: center;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    background-color: var(--gray-50);
}

@media (min-width: 1024px) {
    header > div > div:last-child > div { display: flex; }
}

/* Header Buttons */
header button {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

header button:nth-of-type(1) { /* Accedi */
    background-color: var(--brand-green);
    color: white;
}

header button:nth-of-type(2) { /* Registrati */
    background-color: #dcfce7;
    color: var(--brand-green);
    border: 1px solid var(--brand-green);
}

header button:nth-of-type(3) { /* Scarica App */
    display: none;
    border: 1px solid var(--gray-300);
    background-color: transparent;
}

@media (min-width: 640px) { header button:nth-of-type(3) { display: block; } }

@media (max-width: 640px) {
    header > div { padding-right: 0.5rem; padding-left: 0.5rem; }
    header > div > div:first-child > a > div { padding: 0.2rem 0.5rem; font-size: 1rem; }
    header > div > div:first-child > a > span { font-size: 1rem; }
    header button { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    header > div > div:last-child { column-gap: 0.25rem; }
}

/* Main Content */

/* Hero Section */
main > section:first-of-type {
    width: 100%;
}

/* Hero Container */
main > section:first-of-type > div {
    background-color: #0a2e15;
    background-image: url('https://images.unsplash.com/photo-1596838132731-dd36a1f3ec44?auto=format&fit=crop&q=80&w=1200');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 450px;
    display: flex;
    align-items: center;
}

/* Hero Content Wrapper */
main > section:first-of-type > div > div:first-child {
    position: relative;
    z-index: 10;
    color: white;
    width: 100%;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) { main > section:first-of-type > div > div:first-child { max-width: 640px; } }
@media (min-width: 768px) { main > section:first-of-type > div > div:first-child { max-width: 768px; } }
@media (min-width: 1024px) { main > section:first-of-type > div > div:first-child { max-width: 1024px; } }
@media (min-width: 1280px) { main > section:first-of-type > div > div:first-child { max-width: 1280px; } }

/* Hero Text Block */
main > section:first-of-type > div > div:first-child > div {
    max-width: 42rem;
    padding-left: 5px;
    padding-right: 5px;
}

/* Hero Title */
main > section:first-of-type h1 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    word-break: break-word;
}
@media (min-width: 768px) { main > section:first-of-type h1 { font-size: 3.75rem; } }

/* Hero Subtitle */
main > section:first-of-type p {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 2rem;
    color: var(--gray-200);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
@media (min-width: 768px) { main > section:first-of-type p { font-size: 1.5rem; } }

/* Hero Button */
main > section:first-of-type button {
    background-color: var(--brand-green);
    color: white;
    padding: 1.25rem 2.5rem;
    border-radius: 0.75rem;
    font-weight: 900;
    font-size: 1.25rem;
    text-transform: uppercase;
    box-shadow: 0 10px 15px -3px rgba(0, 200, 83, 0.3);
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}
main > section:first-of-type button:hover { background-color: var(--brand-green-hover); }

/* Hero Image */
main > section:first-of-type > div > div:last-child {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    pointer-events: none;
    z-index: 1;
}

main > section:first-of-type > div > div:last-child img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    opacity: 0.6;
    object-position: center top;
}

@media (min-width: 768px) {
    main > section:first-of-type > div > div:last-child { width: auto; }
    main > section:first-of-type > div > div:last-child img {
        opacity: 0.8;
        mix-blend-mode: screen;
        object-position: center;
    }
}

/* Article Section */
main > article {
    padding: 3rem 1rem;
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

main > article h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

main > article > div:first-of-type {
    color: var(--gray-700);
    line-height: 1.625;
}

main > article p { margin-bottom: 1rem; }
main > article h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
main > article ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}
main > article li { margin-bottom: 0.5rem; }

/* Table */
main > article > div:last-of-type {
    margin-top: 3rem;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

main > article table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

main > article th {
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

main > article td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 500;
}
main > article tr:last-child td { border-bottom: none; }

@media (max-width: 640px) {
    main > article table thead {
        display: none;
    }
    
    main > article table tr {
        display: block;
        border-bottom: 2px solid var(--gray-200);
    }
    
    main > article table tr:last-child {
        border-bottom: none;
    }
    
    main > article table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--gray-100);
        padding: 1rem;
        text-align: right;
    }
    
    main > article table td:last-child {
        border-bottom: none;
    }
    
    main > article table td::before {
        font-weight: 700;
        color: var(--gray-900);
        margin-right: 1rem;
        text-align: left;
    }
    
    main > article table td:nth-of-type(1)::before { content: "Offerta"; }
    main > article table td:nth-of-type(2)::before { content: "Valore Massimo"; }
    main > article table td:nth-of-type(3)::before { content: "Codice"; }
}

main > article td span {
    background-color: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

/* App Section */
#app {
    background-color: var(--blue-600);
    padding-top: 4rem;
    padding-bottom: 4rem;
    color: white;
}

#app > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
}

@media (min-width: 640px) { #app > div { max-width: 640px; } }
@media (min-width: 768px) { #app > div { max-width: 768px; flex-direction: row; } }
@media (min-width: 1024px) { #app > div { max-width: 1024px; } }
@media (min-width: 1280px) { #app > div { max-width: 1280px; } }

#app > div > div:first-child {
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 100%;
    padding-left: 5px;
    padding-right: 5px;
}
@media (min-width: 768px) { #app > div > div:first-child { width: 50%; margin-bottom: 0; } }

#app h2 {
    font-size: 2.25rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    line-height: 1;
}

#app p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

#app > div > div:first-child > div {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

#app a {
    background-color: black;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-700);
    width: 180px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    text-decoration: none;
}
#app a:hover { background-color: #111; }

#app a svg {
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0.75rem;
    fill: currentColor;
}

#app a div small {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1;
    margin-bottom: 0.25rem;
}

#app a div span {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1;
}

#app > div > div:last-child {
    width: 100%;
}
@media (min-width: 768px) { #app > div > div:last-child { width: 33.333333%; } }

#app > div > div:last-child > div {
    background-color: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

#app > div > div:last-child > div > div {
    background-color: var(--gray-800);
    border-radius: 1rem;
    aspect-ratio: 9/16;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app > div > div:last-child > div > div img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    opacity: 0.8;
    mix-blend-mode: screen;
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid var(--gray-200);
    margin-top: 3rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

footer > div > div:first-child {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
}
@media (min-width: 768px) { footer > div > div:first-child { flex-direction: row; } }

/* Footer Brand */
footer > div > div:first-child > div:first-child {
    max-width: 20rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) { footer > div > div:first-child > div:first-child { margin-bottom: 0; } }

footer > div > div:first-child > div:first-child > div {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    column-gap: 0.5rem;
}

footer > div > div:first-child > div:first-child p {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
}

/* Footer Links */
footer > div > div:first-child > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
@media (min-width: 768px) { footer > div > div:first-child > div:last-child { grid-template-columns: repeat(3, 1fr); } }

footer h4 {
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--gray-400);
}

footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: 0.5rem; }
footer a {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
}
footer a:hover { color: var(--brand-green); }

/* Footer Bottom */
footer > div > div:last-child {
    border-top: 1px solid var(--gray-200);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--gray-400);
    letter-spacing: -0.025em;
}
@media (min-width: 768px) { footer > div > div:last-child { flex-direction: row; } }

footer > div > div:last-child > div:first-child {
    display: flex;
    align-items: center;
    column-gap: 1.5rem;
    margin-bottom: 1rem;
    font-style: italic;
    opacity: 0.5;
}
@media (min-width: 768px) { footer > div > div:last-child > div:first-child { margin-bottom: 0; } }