:root {
    --primary-color: #f8b109;
    --primary-light: #ffc847;
    --whatsapp-color: #25D366;
    --whatsapp-hover: #1EBE5D;
    --text-color: #f1f5f9;
    --text-light: #94a3b8;
    --bg-color: #0b1120; /* Più profondo */
    --surface-color: rgba(30, 41, 59, 0.7); /* Semi-trasparente per l'effetto glassmorphism */
    --border-color: rgba(51, 65, 85, 0.5);
    --error-color: #ef4444;
    --input-bg: #0f172a;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    --accent-glow: rgba(248, 177, 9, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 0% 0%, var(--accent-glow) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, var(--accent-glow) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 520px; /* Form stretto come richiesto */
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--surface-color);
    padding: 12px 0;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    padding: 0 30px; /* Full width con padding laterale */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    animation: fadeInDown 0.8s ease-out forwards;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-text-brand {
    margin-left: 15px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.1;
}

.logo-text-brand span {
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
}

/* Classe per il logo immagine */
.logo-img {
    max-height: 80px; /* Logo più grande */
    width: auto;
}

/* Hero Section (Testuale nel body) */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1.1;
    margin-bottom: 12px;
}

.hero-title span {
    font-size: 24px;
    font-weight: 500;
    color: var(--primary-color);
    display: block;
    margin-top: 6px;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 400;
    max-width: 400px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding: 20px 0 60px;
}

.form-wrapper {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 30px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 30px;
    text-align: center;
}

/* Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 15px;
    color: var(--text-color);
    background-color: var(--input-bg);
    transition: all 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #a0aec0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30, 90, 140, 0.1);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

select:invalid, select option[value=""] {
    color: #a0aec0;
}
select option {
    color: var(--text-color);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Error States */
.error-message {
    font-size: 12px;
    color: var(--error-color);
    margin-top: 4px;
    display: none;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--error-color);
}

.form-group.has-error .error-message {
    display: block;
}

/* Checkbox */
.checkbox-group {
    margin-top: 10px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-light);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-light);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    line-height: 1.5;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, var(--whatsapp-color) 0%, var(--whatsapp-hover) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 18px 24px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    box-shadow: 0 10px 20px -10px rgba(37, 211, 102, 0.5);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(37, 211, 102, 0.6);
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

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

.form-footer-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 10px;
}

/* Message Preview */
.message-preview {
    margin-top: 30px;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background-color: rgba(255, 255, 255, 0.03);
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
    opacity: 0;
}

.preview-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.preview-content {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--text-color);
    white-space: pre-wrap;
    line-height: 1.5;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 0 15px;
    }

    .form-wrapper {
        padding: 20px;
    }

    .hero-title {
        font-size: 28px;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}
