:root {
    --primary-green: #2d6a4f;
    --bg-beige: #fefaf0;
    --text-color: #2d3436;
    --white: #ffffff;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-beige);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    
    /* Integrated Corner Accent (Solid Triangle) + Grain */
    background-image: 
        /* The solid triangle in the corner - Clean and Minimalist */
        url("data:image/svg+xml,%3Csvg width='600' height='600' viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 600 L 600 0 L 600 600 Z' fill='%232d6a4f' /%3E%3C/svg%3E"),
        /* Subtle Grain */
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    
    background-attachment: scroll, fixed;
    background-position: bottom right, center;
    background-repeat: no-repeat, repeat;
    background-size: 600px 600px, auto;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.header {
    width: 100%;
    height: 480px;
    background: url('img/header.png') no-repeat center center;
    background-size: cover;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 60px 2% 60px 8%;
    position: relative;
    overflow: hidden; /* To prevent the curve from showing outside header if it's too large */
}

.header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(to bottom, transparent, var(--bg-beige));
    z-index: 2; /* Increased to cover the ::after (pancita) */
    pointer-events: none;
}

.header::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -250px;
    transform: translateY(-50%);
    width: 650px;
    height: 900px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    z-index: 1;
    box-shadow: -15px 0 40px rgba(0,0,0,0.06);
}

.header-logos {
    display: flex;
    flex-direction: column;
    gap: 40px;
    height: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 3; /* Increased to stay above the gradient fade */
    padding-right: 0;
}

.logo-img {
    height: 140px;
    width: 280px;
    object-fit: contain;
    /* CSS filter to turn images into the primary green (#2d6a4f) */
    filter: brightness(0) saturate(100%) invert(31%) sepia(48%) saturate(692%) hue-rotate(107deg) brightness(96%) contrast(89%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.logo-img:hover {
    filter: brightness(0) saturate(100%) invert(31%) sepia(48%) saturate(692%) hue-rotate(107deg) brightness(120%) contrast(89%);
    transform: scale(1.05); /* Added a slight zoom on hover */
}

.logo-link {
    text-decoration: none;
    display: inline-block;
}

.header-content {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    color: var(--primary-green);
    max-width: 700px;
}

.header-title {
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.title-top {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    letter-spacing: 2px;
}

.title-main {
    font-size: 6rem;
    font-weight: 900;
    display: block;
    margin-top: -5px;
    letter-spacing: -2px;
}

.separator {
    width: 100%;
    height: 1px;
    background-color: var(--primary-green);
    opacity: 0.6;
    margin: 10px 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

.info-item i {
    width: 20px;
    height: 20px;
}

.form-title-section {
    margin-top: -100px;
    padding: 0 8%;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
}

.form-title-container {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 15px 40px 15px 70px; /* More left padding for the overlapping icon */
    border-radius: 50px;
    display: flex;
    align-items: center;
    position: relative; /* Essential for absolute positioning of the icon */
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.form-title-icon {
    width: 90px;
    height: 90px;
    background-color: #b5e48c; /* More leaf-like, yellowish green */
    color: var(--primary-green); /* Dark green icon for better contrast on leaf color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border: 4px solid var(--primary-green); /* Matches the main div color */
}

.title-img {
    display: block;
    width: 45px;
    height: 45px;
    object-fit: contain;
    margin: 0;
    /* Optical adjustment to the right (refined) */
    transform: translateX(3px);
    /* Using the same green filter as the logos */
    filter: brightness(0) saturate(100%) invert(31%) sepia(48%) saturate(692%) hue-rotate(107deg) brightness(96%) contrast(89%);
}

.form-title-container h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.main-container {
    max-width: 1400px; 
    margin: 20px auto 40px;
    padding: 0 40px;
    position: relative;
    z-index: 5; 
}


.sector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    grid-auto-rows: 1fr; 
    gap: 12px;
    margin-top: 15px;
}


@media (max-width: 992px) {
    .sector-grid {
        grid-template-columns: repeat(2, 1fr); 
    }
}

.subscription-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    gap: 12px; 
    margin-top: 15px;
    width: 100%;
}

.sub-card {
    flex: 0 1 225px; 
    min-height: 130px; 
    position: relative;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.sub-card:hover {
    border-color: var(--primary-green);
    transform: translateY(-5px);
    background-color: #f0f7f4;
}

.sub-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.sub-card .sub-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sub-icon-wrapper {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sub-icon-wrapper img,
.sub-icon-wrapper i {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(31%) sepia(48%) saturate(692%) hue-rotate(107deg) brightness(96%) contrast(89%);
    transition: all 0.3s ease;
}

.sub-card span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.sub-card.active {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    box-shadow: 0 10px 20px rgba(45, 106, 79, 0.2);
}

.sub-card.active span {
    color: var(--white);
}

.sub-card.active .sub-icon-wrapper img,
.sub-card.active .sub-icon-wrapper i {
    filter: brightness(0) invert(1);
    transform: scale(1.1);
}

.sub-card-negative:hover {
    background-color: #fff0f0;
    border-color: #ef4444;
}

.sub-card-negative.active {
    background-color: #2d3436; 
    border-color: #2d3436;
}

.sector-tile {
    position: relative;
    cursor: pointer;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    height: 100%; 
}


.sector-tile:hover {
    border-color: var(--primary-green);
    background-color: #f0f7f4;
}

.sector-tile input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.tile-check {
    width: 18px;
    height: 18px;
    border: 2px solid #ced4da;
    border-radius: 5px;
    background-color: white;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sector-tile.active {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: var(--white);
}

.sector-tile.active .tile-check {
    background-color: var(--white);
    border-color: var(--white);
}

.sector-tile.active .tile-check::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid var(--primary-green);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mt-20 { margin-top: 20px; }

.registration-card {
    background-color: var(--white);
    padding: 60px;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.06);
    margin-top: -60px; 
    position: relative;
    z-index: 5;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 40px;
}

.form-field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-field-wrapper label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-green);
    margin-left: 5px;
}

/* Icon Input Group - Refined positioning */
.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-group i,
.input-icon-group svg {
    position: absolute;
    left: 20px;
    width: 20px;
    height: 20px;
    color: var(--primary-green) !important; /* Ensure it overrides any library defaults */
    stroke: var(--primary-green) !important;
    pointer-events: none;
    z-index: 2;
}

.input-icon-group input, 
.input-icon-group select {
    width: 100%;
    padding: 15px 15px 15px 55px; /* Ample space for the icon */
    border: 2px solid #e9ecef;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: var(--white);
    position: relative;
    z-index: 1;
}

.input-icon-group input:focus, 
.input-icon-group select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.1);
    background-color: #f8fdfb;
}

.separator-dots {
    height: 1px;
    background: radial-gradient(circle, #ced4da 2px, transparent 3px);
    background-size: 20px 1px;
    margin: 50px 0;
    opacity: 0.5;
}

.form-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.25rem;
    color: var(--primary-green);
    margin-bottom: 25px;
    font-weight: 700;
    line-height: 1.3;
}

.section-title small {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 4px;
}

.form-actions {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.btn-submit {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 20px 80px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 35px rgba(27, 67, 50, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-submit:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(27, 67, 50, 0.35);
}

@media (max-width: 992px) {
    .header {
        flex-direction: column;
        height: auto;
        min-height: 450px;
        padding: 40px 5%;
        gap: 40px;
        align-items: center;
        text-align: center;
    }

    .header-logos {
        flex-direction: row;
        height: auto;
        padding-right: 0;
    }

    .header::after {
        display: none;
    }

    .header-content {
        align-items: center;
        text-align: center;
    }

    .title-main {
        font-size: 3.5rem;
    }

    .logo-img {
        height: 80px;
        width: 150px;
        filter: brightness(0) invert(1); /* Turned white for mobile as requested */
    }

    .form-title-section {
        text-align: center;
        margin-top: -30px; /* Overlaps header again */
        padding: 0 20px;
        position: relative;
        z-index: 10;
    }

    .form-title-container {
        padding: 12px 30px 12px 60px;
        width: auto;
        max-width: 100%;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .form-title-icon {
        width: 70px;
        height: 70px;
        left: -15px;
        border-width: 2px;
    }

    .main-container {
        margin-top: 0; 
        padding: 0 15px;
        margin-bottom: 50px;
        position: relative;
        z-index: 5;
    }

    .registration-card {
        padding: 35px 20px;
        border-radius: 30px;
        margin-top: -20px; /* Tucks under the title section as requested */
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* --- Success Modal Styles (Moved from HTML) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(27, 63, 47, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: white;
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}
.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}
.modal-icon {
    width: 80px;
    height: 80px;
    background: #f0f7f4;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    color: #2d6a4f;
}
.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #1b3f2f;
    margin-bottom: 12px;
}
.modal-text {
    color: #555;
    line-height: 1.6;
    margin-bottom: 30px;
}
.btn-modal {
    background: #2d6a4f;
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}
.btn-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(45, 106, 79, 0.2);
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    padding: 14px 28px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.15);
}
.btn-whatsapp:hover {
    transform: translateY(-2px);
    background: #20ba5a;
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.25);
}

/* Loading state */
.btn-submit.loading {
    opacity: 0.7;
    pointer-events: none;
}
.btn-submit.loading i {
    animation: spin 1s infinite linear;
}
@keyframes spin { from {transform: rotate(0deg);} to {transform: rotate(360deg);} }
