/* =============================================================
   COMPONENTS.CSS — Bottoni, card, form, accordion, badge
   ============================================================= */

/* --- BOTTONI --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    font-family: var(--f-sans);
    font-size: var(--t-sm);
    font-weight: 600;
    line-height: 1;
    padding: 14px 28px;
    border-radius: var(--r-sm);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--tr-fast), color var(--tr-fast),
        border-color var(--tr-fast), box-shadow var(--tr-fast),
        transform var(--tr-fast);
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

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

.btn--primary {
    background: var(--c-accent);
    color: var(--c-white);
    border-color: var(--c-accent);
}

.btn--primary:hover {
    background: var(--c-accent-dk);
    border-color: var(--c-accent-dk);
    color: var(--c-white);
    box-shadow: 0 4px 16px rgba(232, 97, 42, 0.35);
}

.btn--secondary {
    background: transparent;
    color: var(--c-brand);
    border-color: var(--c-brand);
}

.btn--secondary:hover {
    background: var(--c-brand);
    color: var(--c-white);
}

.btn--ghost {
    background: transparent;
    color: var(--c-white);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.7);
    color: var(--c-white);
}

.btn--sm {
    font-size: var(--t-xs);
    padding: 10px 20px;
}

.btn--lg {
    font-size: var(--t-base);
    padding: 18px 36px;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --- CARD --- */
.card {
    background: var(--c-white);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border-lt);
    overflow: hidden;
    transition: box-shadow var(--tr-base), transform var(--tr-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card__body {
    padding: var(--sp-8);
}

.card__img {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--tr-slow);
}

.card:hover .card__img img {
    transform: scale(1.04);
}

/* Card servizio */
.service-card {
    background: var(--c-white);
    border: 1px solid var(--c-border-lt);
    border-radius: var(--r-lg);
    padding: var(--sp-8);
    transition: box-shadow var(--tr-base), border-color var(--tr-base), transform var(--tr-base);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--c-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--tr-base);
}

.service-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--c-border);
    transform: translateY(-4px);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card__icon {
    width: 52px;
    height: 52px;
    background: rgba(26, 58, 92, 0.06);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-5);
    color: var(--c-brand);
}

.service-card__icon svg {
    width: 24px;
    height: 24px;
}

.service-card h3 {
    font-family: var(--f-sans);
    font-size: var(--t-lg);
    font-weight: 600;
    color: var(--c-brand);
    margin-bottom: var(--sp-3);
}

.service-card p {
    font-size: var(--t-sm);
    color: var(--c-muted);
    line-height: 1.7;
    margin-bottom: var(--sp-5);
}

.service-card a.link-arrow {
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-accent);
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    transition: gap var(--tr-fast);
}

.service-card a.link-arrow:hover {
    gap: var(--sp-3);
    color: var(--c-accent-dk);
}

/* Card comune */
.city-card {
    position: relative;
    border-radius: var(--r-xl);
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    display: block;
}

.city-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--tr-slow);
}

.city-card:hover img {
    transform: scale(1.05);
}

.city-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 31, 45, 0.85) 0%, rgba(15, 31, 45, 0.1) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--sp-8);
    transition: background var(--tr-base);
}

.city-card:hover .city-card__overlay {
    background: linear-gradient(to top, rgba(15, 31, 45, 0.95) 0%, rgba(15, 31, 45, 0.2) 60%);
}

.city-card__name {
    font-family: var(--f-serif);
    font-size: var(--t-3xl);
    color: var(--c-white);
    line-height: 1.1;
    margin-bottom: var(--sp-2);
}

.city-card__sub {
    font-size: var(--t-sm);
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--tr-fast);
}

.city-card:hover .city-card__sub {
    color: var(--c-accent-lt);
}

/* Card testimonianza */
.testimonial-card {
    background: var(--c-white);
    border: 1px solid var(--c-border-lt);
    border-radius: var(--r-lg);
    padding: var(--sp-8);
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    font-family: var(--f-serif);
    font-size: 80px;
    line-height: 1;
    color: var(--c-accent);
    opacity: 0.15;
    position: absolute;
    top: var(--sp-4);
    left: var(--sp-6);
}

.testimonial-card__text {
    font-size: var(--t-base);
    line-height: 1.8;
    color: var(--c-text);
    margin-bottom: var(--sp-6);
    position: relative;
    z-index: 1;
}

.testimonial-card__author {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

.testimonial-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-surface);
}

.testimonial-card__name {
    font-weight: 600;
    font-size: var(--t-sm);
    color: var(--c-brand);
}

.testimonial-card__role {
    font-size: var(--t-xs);
    color: var(--c-muted);
}

/* --- STEP (processo) --- */
.step-list {
    counter-reset: steps;
}

.step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: var(--sp-6);
    align-items: start;
    position: relative;
    padding-bottom: var(--sp-10);
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 56px;
    left: 27px;
    width: 2px;
    height: calc(100% - 56px);
    background: var(--c-border);
}

.step__num {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-brand);
    color: white;
    font-family: var(--f-mono);
    font-size: var(--t-lg);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step__content h3 {
    font-family: var(--f-sans);
    font-size: var(--t-xl);
    font-weight: 600;
    color: var(--c-brand);
    margin-bottom: var(--sp-3);
    padding-top: 10px;
}

.step__content p {
    color: var(--c-muted);
    font-size: var(--t-sm);
    line-height: 1.8;
}

/* --- FAQ ACCORDION --- */
.faq {
    max-width: 100%;
}

.faq__item {
    border-bottom: 1px solid var(--c-border-lt);
}

.faq__item:first-child {
    border-top: 1px solid var(--c-border-lt);
}

.faq__question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    padding-block: var(--sp-5);
    font-family: var(--f-sans);
    font-size: var(--t-base);
    font-weight: 600;
    color: var(--c-brand);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color var(--tr-fast);
}

.faq__question:hover {
    color: var(--c-accent);
}

.faq__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--c-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--tr-base), background var(--tr-fast);
}

.faq__icon svg {
    width: 12px;
    height: 12px;
    color: var(--c-brand);
}

.faq__item.is-open .faq__icon {
    transform: rotate(180deg);
    background: var(--c-accent);
}

.faq__item.is-open .faq__icon svg {
    color: white;
}

.faq__answer {
    display: none;
    padding-bottom: var(--sp-6);
    color: var(--c-muted);
    font-size: var(--t-base);
    line-height: 1.8;
}

.faq__item.is-open .faq__answer {
    display: block;
}

/* --- CTA BANNER --- */
.cta-banner {
    background: var(--c-accent);
    color: var(--c-white);
    padding-block: var(--sp-16);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

.cta-banner::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.cta-banner__inner {
    position: relative;
    z-index: 1;
}

.cta-banner h2 {
    color: var(--c-white);
    margin-bottom: var(--sp-4);
}

.cta-banner p {
    font-size: var(--t-lg);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--sp-8);
    max-width: 560px;
    margin-inline: auto;
    margin-bottom: var(--sp-8);
}

.cta-banner .btn--primary {
    background: var(--c-white);
    color: var(--c-accent);
    border-color: var(--c-white);
}

.cta-banner .btn--primary:hover {
    background: var(--c-dark);
    border-color: var(--c-dark);
    color: var(--c-white);
}

/* --- FORM --- */
.form {
    width: 100%;
}

.form__group {
    margin-bottom: var(--sp-5);
}

.form__label {
    display: block;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: var(--sp-2);
}

.form__label span {
    color: var(--c-accent);
}

.form__input,
.form__select,
.form__textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--t-base);
    color: var(--c-text);
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
    appearance: none;
}

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.08);
}

.form__input::placeholder,
.form__textarea::placeholder {
    color: var(--c-subtle);
}

.form__textarea {
    resize: vertical;
    min-height: 120px;
}

.form__select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%235c6b7a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form__error {
    display: block;
    font-size: var(--t-xs);
    color: var(--c-error);
    margin-top: var(--sp-2);
}

.form__success {
    padding: var(--sp-5) var(--sp-6);
    background: rgba(34, 134, 58, 0.08);
    border: 1px solid rgba(34, 134, 58, 0.25);
    border-radius: var(--r-md);
    color: var(--c-success);
    font-weight: 500;
    font-size: var(--t-sm);
    text-align: center;
    display: none;
}

/* Checkbox personalizzata */
.form__check {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    cursor: pointer;
}

.form__check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--c-accent);
    cursor: pointer;
}

.form__check-label {
    font-size: var(--t-sm);
    color: var(--c-muted);
    line-height: 1.5;
}

.form__check-label a {
    color: var(--c-brand);
    font-weight: 500;
}

/* --- BADGE / PILL --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--t-xs);
    font-weight: 500;
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--r-full);
    border: 1px solid;
}

.badge--brand {
    color: var(--c-brand);
    background: rgba(26, 58, 92, 0.06);
    border-color: rgba(26, 58, 92, 0.15);
}

.badge--accent {
    color: var(--c-accent);
    background: rgba(232, 97, 42, 0.08);
    border-color: rgba(232, 97, 42, 0.2);
}

.badge--white {
    color: var(--c-white);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* --- FEATURE LIST (checkmark) --- */
.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    font-size: var(--t-base);
    line-height: 1.6;
}

.feature-list li::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23e8612a'%3e%3cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: contain;
    margin-top: 3px;
}

/* --- STATS --- */
.stat-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-8);
}

.stat {
    min-width: 120px;
}

.stat__value {
    font-family: var(--f-serif);
    font-size: var(--t-5xl);
    color: var(--c-accent);
    line-height: 1;
    display: block;
}

.stat__label {
    font-size: var(--t-xs);
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-top: var(--sp-2);
}

/* --- TABS --- */
.tabs {
    border-bottom: 1px solid var(--c-border-lt);
    display: flex;
    gap: 0;
    margin-bottom: var(--sp-10);
}

.tab-btn {
    padding: var(--sp-3) var(--sp-6);
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color var(--tr-fast), border-color var(--tr-fast);
    white-space: nowrap;
}

.tab-btn.is-active {
    color: var(--c-brand);
    border-bottom-color: var(--c-accent);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

/* --- Pill tecnico --- */
.tech-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    font-family: var(--f-mono);
    font-size: var(--t-xs);
    color: var(--c-brand);
    font-weight: 500;
}

.tech-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

/* --- Sezione highlight alternata --- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-16);
    align-items: center;
}

.split--reverse {
    direction: rtl;
}

.split--reverse>* {
    direction: ltr;
}

@media (max-width: 768px) {
    .split {
        grid-template-columns: 1fr;
    }

    .split--reverse {
        direction: ltr;
    }
}