:root {
    /* Palette */
    --color-saffron: #F6C531;
    --color-jasmine: #F8DE8C;
    --color-cosmic-latte: #FAF7E6;
    --color-sage: #A9B494;
    --color-fern-green: #587042;

    /* Typography */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --blur-amount: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-cosmic-latte);
    color: var(--color-fern-green);
    line-height: 1.8;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-fern-green);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--color-cosmic-latte);
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-fern-green) 0%, var(--color-sage) 100%);
    /* Fallback background se il video non carica */
}

#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    min-width: 100%;
    min-height: 100%;
    z-index: 0;
    transform: translate(-50%, -50%);
    object-fit: cover;
    pointer-events: none;
    display: block;
}

#bg-video-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -3;
    transform: translate(-50%, -50%);
    object-fit: cover;
    display: none;
    /* Mostrato solo se l'iframe YouTube non carica */
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(88, 112, 66, 0.4);
    /* Fern Green overlay */
    z-index: 1;
}

.floral-frame-top {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 250px;
    margin-bottom: -100px;
    /* Adjust height as needed */
    background-image: url('fiori.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: contain;
    z-index: 3;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
    background: rgba(88, 112, 66, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--glass-shadow);
    animation: fadeInUp 1.5s ease-out;
    margin: 0;
    max-width: 950px;
    width: 100%;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--color-jasmine);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    white-space: pre-wrap;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-cosmic-latte);
    font-weight: 300;
    letter-spacing: 1px;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-saffron), var(--color-jasmine));
    color: var(--color-fern-green);
    padding: 15px 40px;
    font-family: var(--font-heading);
    font-weight: bold;
    border-radius: 50px;
    transition: all 0.4s ease;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(246, 197, 49, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(246, 197, 49, 0.6);
    background: linear-gradient(135deg, var(--color-jasmine), var(--color-saffron));
}

/* --- Sections General --- */
section {
    padding: 100px 0;
    position: relative;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--color-sage);
    margin-bottom: 3rem;
    font-weight: 300;
    text-align: center;
}

h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    display: inline-block;
    width: 100%;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: var(--color-saffron);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* --- Story Section --- */
.story {
    background-color: var(--color-cosmic-latte);
    text-align: center;
}

.castle-container {
    margin-top: 40px;
    position: relative;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
}

/* Removed the rigid border to suit the sketch style */
.castle-container::before {
    display: none;
}

.castle-img {
    position: relative;
    z-index: 1;
    max-width: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
    aspect-ratio: auto;
    /* Remove box-shadow for a cleaner sketch look, or use a very subtle one */
    filter: sepia(20%) contrast(1.1);
    /* Warm it up slightly */
    mix-blend-mode: multiply;
    /* Blends the white background of the sketch with the page */
    transition: transform 0.5s ease;
}

.castle-img:hover {
    transform: scale(1.02) rotate(1deg);
}

.wedding-info {
    margin-top: 40px;
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.wedding-info p {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--color-fern-green);
    line-height: 1.8;
}

.wedding-info p:last-child {
    margin-bottom: 0;
}

.wedding-info strong {
    font-family: var(--font-heading);
    color: var(--color-fern-green);
    font-size: 1.3rem;
}

/* --- Program Section --- */
.program {
    background: linear-gradient(to bottom, var(--color-cosmic-latte), #fff);
    text-align: center;
}

.timeline {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 60px;
}

.event {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(169, 180, 148, 0.2);
}

.event:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.event .icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-jasmine);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: 0 8px 20px rgba(248, 222, 140, 0.5);
    color: white;
}

.event .icon i {
    font-size: 2.5rem;
    color: white;
}

.event h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--color-fern-green);
}

.event p {
    font-weight: bold;
    color: var(--color-saffron);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* --- Location Section --- */
.location {
    background-color: var(--color-cosmic-latte);
    text-align: center;
    background-image: radial-gradient(var(--color-sage) 1px, transparent 1px);
    background-size: 30px 30px;
}

.location-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 60px;
    flex-wrap: wrap;
}

.location-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 25px;
    width: 350px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    border: 1px solid white;
}

.location-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}

.icon-large {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.1));
    color: var(--color-fern-green);
}

.icon-large i {
    font-size: 4rem;
    color: var(--color-fern-green);
}

.btn-small {
    display: inline-block;
    margin-top: 25px;
    padding: 10px 30px;
    background-color: var(--color-fern-green);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn-small:hover {
    background-color: var(--color-sage);
    transform: scale(1.05);
}

/* --- Witnesses Section --- */
.witnesses {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--color-sage), var(--color-fern-green));
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.witnesses::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: rotate 60s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.witnesses h2 {
    color: white;
    z-index: 1;
    position: relative;
}

.witnesses h2::after {
    background: var(--color-jasmine);
}

.witnesses-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 60px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.witness {
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 20px;
    width: 220px;
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s;
}

.witness:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
}

.witness h3 {
    color: var(--color-jasmine);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.witness p {
    font-size: 1.1rem;
    font-weight: 300;
}

/* --- RSVP Section --- */
.rsvp-section {
    padding: 100px 0;
    background-color: var(--color-cosmic-latte);
    position: relative;
}

.rsvp-section h2 {
    color: var(--color-fern-green);
}

form {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(88, 112, 66, 0.15);
    border: 1px solid rgba(169, 180, 148, 0.3);
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: var(--color-fern-green);
    font-size: 1.1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--color-cosmic-latte);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-saffron);
    background: white;
}

.radio-group {
    display: flex;
    gap: 20px;
    background: var(--color-cosmic-latte);
    padding: 15px;
    border-radius: 12px;
}

.radio-group label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
}

input[type="radio"] {
    accent-color: var(--color-fern-green);
    width: 20px;
    height: 20px;
}

.guest-entry {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    border-left: 5px solid var(--color-saffron);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.btn-submit {
    width: 100%;
    font-size: 1.3rem;
    margin-top: 20px;
}

/* --- Wedding Planner Section --- */
.wedding-planner {
    background: linear-gradient(135deg, var(--color-cosmic-latte) 0%, rgba(250, 247, 230, 0.8) 100%);
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid rgba(169, 180, 148, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.wedding-planner .container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.planner-content {
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.planner-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--color-saffron);
    box-shadow: 0 8px 20px rgba(88, 112, 66, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.planner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.planner-content p {
    color: var(--color-fern-green);
    font-size: 1rem;
    line-height: 1.8;
    margin: 0;
    text-align: center;
    max-width: 500px;
}

.planner-content strong {
    font-family: var(--font-heading);
    color: var(--color-fern-green);
    font-weight: 700;
    font-size: 1.1rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px;
    background-color: var(--color-fern-green);
    color: var(--color-cosmic-latte);
    font-family: var(--font-heading);
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        padding: 60px 10px;
    }

    .floral-frame-top {
        height: 240px;
        margin-bottom: -110px;
    }

    .hero-content {
        padding: 3rem 1.5rem;
    }

    .hero-content h1 {
        font-size: clamp(2.8rem, 12vw, 4rem);
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .hero-content .btn {
        padding: 18px 50px;
        font-size: 1.3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    .timeline {
        flex-direction: column;
        align-items: center;
    }

    .event {
        width: 100%;
        max-width: 350px;
    }

    .radio-group {
        flex-direction: column;
    }

    form {
        padding: 30px 20px;
    }

    .planner-image {
        width: 120px;
        height: 120px;
    }

    .planner-content {
        padding: 20px;
    }
}