/* Color Palette */
:root {
    --primary-color: #d1b79c;
    --primary-color-light: #e6d8c9;
    --dark-text-color: #333;
    --light-text-color: #fff;
    --background-color: #f7f5f2;
    --light-gray: #e0e0e0;
    /* New color for Start Button */
    --start-btn-color: #7F5C38; 
    /* NOU: Culoarea verde pentru butonul de trimitere */
    --success-color: #007137;
}

/* Global Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--dark-text-color);
    line-height: 1.6;
}

/* NOU: Asigură că butoanele folosesc fontul Poppins */
button,
.btn {
    font-family: 'Poppins', sans-serif;
}

h1, h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    /* Added back default margin for correct spacing */
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2.5rem;
    /* Added back default margin for correct spacing */
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1rem;
    color: #666;
}

/* Start Button Styling */
.start-btn {
    padding: 16px 40px;
    border: none;
    background-color: var(--start-btn-color); /* Updated to new color */
    color: var(--light-text-color); /* Text color set to white */
    font-size: 1.15rem;
    font-weight: normal;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.02em;
    margin-top: 1rem;
}

.start-btn:hover {
    background-color: #6a4c30; /* A slightly darker shade for hover effect */
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.start-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.hero {
    background-image: url('hero_background.png');
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--light-text-color);
}

.hero-content {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 2rem;
    border-radius: 10px;
}
/* Removed Flexbox properties to restore original spacing */

/* Project Section (Form) */
.project-section {
    padding: 50px 20px;
    text-align: center;
}

.project-form {
    max-width: 800px;
    margin: 40px auto;
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Form Styling --- */
.progressline {
    position: relative;
    height: 20px;
    margin: 10px 0 24px;
}

.progressline__bar {
    position: absolute;
    inset: auto 0 9px 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-color));
    width: 0%;
    border-radius: 2px;
    transition: width .35s ease;
}

.progressline__dots {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #cfcfcf;
    transition: background .25s ease, transform .25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
}

.dot.active {
    background: var(--primary-color);
    color: var(--light-text-color);
    transform: scale(1.05);
}

.dot.visited {
    background: var(--primary-color-light);
    color: var(--dark-text-color);
}

.step {
    display: none;
}

.step--active {
    display: grid;
    gap: 18px;
}

.step__title {
    font-size: 22px;
    margin: 0 0 4px;
    font-weight: 600;
}

.field {
    display: grid;
    gap: 8px;
}

.field > span,
.field__label {
    font-weight: 500;
    color: #444;
}

/* Added styling for the required asterisk */
.field > span::after,
.field__label::after {
    content: '*';
    color: var(--start-btn-color); /* Folosit pentru a arăta * roșu */
    font-weight: 500;
    position: relative;
    top: -0.5em;
    right: -0.1em;
    font-size: 0.8em;
}

/* NOU: Reguli de excludere precise pentru a ascunde asteriscul la câmpurile opționale */

/* 1. Excluderea pentru Câmpurile de Fișiere (Pasul 2 & 3) */
/* Câmpurile de încărcare au clasa 'custom-file-upload' */
.custom-file-upload > span::after {
    content: none;
}

/* 2. Excluderea pentru Câmpurile Textarea Opționale (Alte nevoi / Descriere stil) */
/* Selectorul :has() verifică dacă în interiorul '.field' există un 'textarea' care NU are atributul 'required' */
.field:has(textarea:not([required])) > span::after {
    content: none;
}

/* --- CONSOLIDATED AND CORRECTED TEXT INPUT STYLING --- */
.field input[type="text"],
.field input[type="number"],
.field input[type="email"], /* FIXED: Ensure this is correctly styled */
.field input[type="tel"],   /* FIXED: Ensure this is correctly styled */
.field textarea,
.field select {
    padding: 12px 14px;
    border: 1px solid var(--light-gray);
    border-radius: 8px; /* The missing piece for 'patratos' fix */
    font: inherit;
    background: #fff;
    transition: box-shadow .2s ease, border-color .2s ease;
    box-sizing: border-box;
    width: 100%;
}

/* Adds red border for invalid fields */
.field input.invalid,
.field textarea.invalid,
.field select.invalid,
.field input[type="email"].invalid,
.field input[type="tel"].invalid {
    border-color: red !important;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.field input[type="email"]:focus,
.field input[type="tel"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(209, 180, 124, .18);
}
/* ---------------------------------------------------- */


.field input[type="file"] {
    padding: 10px;
    border: 1px dashed var(--light-gray);
    border-radius: 8px;
    background: #fafafa;
}

.stack {
    display: grid;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    border: 1px solid var(--light-gray);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background-color: transparent;
}

.option input[type="radio"] {
    display: none;
}

.option span {
    flex-grow: 1;
    cursor: pointer;
    position: relative;
    z-index: 2; /* Ensures text and radio button are on top */
    padding-left: 20px;
}

/* Custom radio button indicator */
.option span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background-color: var(--light-text-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    z-index: 3; /* Ensures the radio button is on top of everything */
}

.option input[type="radio"]:checked + span::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Reinstated background highlight with correct layering */
.option:has(input[type="radio"]:checked) {
    background-color: var(--primary-color-light); /* Apply light background to the parent */
    border-color: var(--primary-color); /* Change border color on selection */
}
.option:hover {
    border-color: var(--primary-color);
}

.grid {
    display: grid;
    gap: 14px;
}

.grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Button alignment */
.actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

/* Align only the first step's button to the right */
.step[data-step="1"] .actions {
    justify-content: flex-end;
}

.btn {
    appearance: none;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-weight: 500;
    cursor: pointer;
    background: var(--light-gray);
    color: var(--dark-text-color);
    transition: transform .08s ease, background .2s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn.prev {
    background-color: transparent;
    color: #666;
    border: 1px solid #ccc;
    padding: 10px 18px;
}

/* Styling for the next button with white background */
.btn.next.btn--primary {
    background: var(--light-text-color);
    color: var(--dark-text-color);
    border: 1px solid var(--light-gray);
}

.btn.next.btn--primary:hover {
    background: var(--primary-color);
    color: var(--light-text-color);
}

/* Butonul de trimitere (Trimite) */
.btn--submit-success {
    background: var(--success-color); /* Fundal verde (#007137) */
    color: var(--light-text-color);   /* Text alb */
}

.btn--submit-success:hover {
    background: #005a2b; /* O nuanță mai închisă pentru efectul de hover */
}

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

.btn--primary:hover {
    background: #bfa58a;
}

/* Testimonials Section */
.testimonials {
    padding: 50px 20px;
    text-align: center;
}

.testimonial-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    text-align: left;
}

.stars {
    color: gold;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.stars span {
    margin-right: 2px;
}

.card p {
    font-style: italic;
    color: #555;
}

.client-info {
    margin-top: 20px;
    font-size: 0.9rem;
}

.client-name {
    font-weight: 600;
    display: block;
}

/* Footer */
.footer {
    background: #333;
    color: #fff;
    padding: 32px 0;
    text-align: center;
    margin-top: 60px;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    .hero-content {
        padding: 1rem;
    }
    .testimonial-cards {
        flex-direction: column;
        align-items: center;
    }
    .grid--2 {
        grid-template-columns: 1fr;
    }
    /* Adjust start button size for tablets */
    .start-btn {
        padding: 14px 35px;
        font-size: 1.05rem;
    }
    /* NOU: Corecție pentru font-size butoane pe iOS */
    .actions .btn {
        font-size: 0.9rem; /* Setează o dimensiune fixă pentru toate butoanele de acțiune */
        -webkit-appearance: none; /* Previne stilizarea implicită iOS */
        -moz-appearance: none; /* Previne stilizarea implicită Firefox */
        appearance: none;
    }
}

@media (max-width: 480px) {
    .project-form {
        padding: 20px;
    }

    /* New rule for file input and labels to prevent overflow */
    .field input[type="file"],
    .field textarea {
        display: block;
        max-width: 100%;
    }

    /* Adjust the previous button for small screens to prevent overlap */
    .btn.prev {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
    /* Mobile line break for the tagline */
    .break-mobile {
        display: block;
    }
    /* Further adjust start button size for mobile */
    .start-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* --- Stiluri pentru Câmpul de Încărcare Fișiere Personalizat (Custom File Input) --- */

.custom-file-upload input[type="file"] {
    /* ASCUNDE input-ul real */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px; /* Adaugă un padding vizual */
    border: 1px dashed var(--light-gray);
    border-radius: 8px;
    background: #fafafa;
    min-height: 48px; /* Asigură o înălțime minimă */
}

.btn-file-trigger {
    /* Stilizează butonul personalizat */
    background: var(--light-gray);
    color: var(--dark-text-color);
    padding: 8px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: background-color 0.2s ease;
    flex-shrink: 0; /* Previne micșorarea butonului */
}

.btn-file-trigger:hover {
    background: #e9e9e9;
}

.file-name-display {
    /* Stilizează textul "Niciun fisier selectat" */
    font-size: 0.95rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Afișează "..." dacă textul este prea lung */
}

/* Stil pentru când un fișier este selectat */
.custom-file-upload.has-file .file-name-display {
    color: var(--dark-text-color);
    font-weight: 500;
}

@media (max-width: 480px) {
    .file-wrapper {
        flex-wrap: wrap; /* Permite elementelor să treacă pe rândul următor pe mobil */
    }
}

/* --- Stiluri pentru Consimțământul GDPR (Pasul 4) --- */

/* Containerul principal al checkbox-ului, forțează afișarea inline a bifei și a textului */
.gdpr-consent {
    display: flex;
    align-items: flex-start; /* Aliniază checkbox-ul în partea de sus */
    gap: 10px;
    margin-top: 15px; /* Spațiu de separare față de câmpurile de deasupra */
}

/* Stil pentru checkbox-ul în sine */
.gdpr-consent input[type="checkbox"] {
    /* Dimensiune implicită a checkbox-ului (poate fi mărită dacă este necesar) */
    transform: scale(1.2);
    flex-shrink: 0; /* Asigură că bifa nu se micșorează */
    margin-top: 5px; /* Aliniază vizual cu prima linie de text */
}

/* Textul propriu-zis (clasa gdpr-text) */
.gdpr-text {
    /* Textul formularului este ~16px. Vom folosi o dimensiune mult mai mică, e.g. 0.7rem (~11.2px) */
    font-size: 0.7rem;
    line-height: 1.5; /* Ajută la citirea textului mic */
    color: #666; /* Îl facem un pic mai pal pentru a contrasta cu textul formularului */
    text-align: left;
}

/* --- Stiluri pentru Câmpuri Invalide (inclusiv GDPR) --- */

/* Nou: Anulăm orice efect vizual pe containerul GDPR. */
.gdpr-consent.invalid {
    border: none;
    background-color: transparent;
    padding: initial;
}
.gdpr-consent.invalid .gdpr-text {
    color: #666; /* Păstrează culoarea originală a textului mic */
}

/* Evidențierea checkbox-ului la validare eșuată */
.gdpr-consent.invalid input[type="checkbox"] {
    /* Aplicăm un chenar roșu vizibil pe căsuța de bifat */
    border: 2px solid darkred;

    /* Adăugăm un box-shadow pentru a face efectul și mai vizibil,
       similar cu un 'glow' roșu, replicând un efect comun de validare */
    box-shadow: 0 0 5px darkred;
}
