/* ==========================================================================
   BASE.CSS — Design Tokens, Reset i Estils d'Elements
   Font única de veritat per a totes les variables del projecte.
   ========================================================================== */

:root {
    /* --- PRIMITIVES --- */
    --color-terracotta: #e87d52;
    --color-terracotta-light: #f0b357;
    --color-cream: #fffaf2;
    --color-beige: #f9f8f4;
    --color-bg-dark: #2c2c2c;
    --color-bg-team: #1a1a1a;
    --color-black-soft: #111111;
    --color-dark-grey: #333;
    --color-grey-muted: #555;
    --color-grey-hint: #888;
    --color-grey-neutral: #999;
    --color-grey-border: #ccc;
    --color-white: #fff;
    --color-white-creamy: #fffdf0;

    /* --- SEMÀNTIQUES --- */
    --color-accent: var(--color-terracotta);
    --color-accent-light: var(--color-terracotta-light);
    --color-text-main: var(--color-cream);
    /* Text sobre fons fosc */
    --color-text-body: var(--color-dark-grey);
    /* Text sobre fons clar */
    --color-text-secondary: #E0E0E0;
    /* Text secundari sobre fosc */

    /* --- OVERLAYS --- */
    --color-overlay-hero: rgba(0, 0, 0, 0.4);
    --color-overlay-dark: rgba(0, 0, 0, 0.6);

    /* --- OMBRES --- */
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 15px 40px rgba(186, 120, 107, 0.12);
    --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.4);

    /* --- TIPOGRAFIA --- */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Montserrat', sans-serif;

    /* --- HEADER --- */
    --header-bg: var(--color-beige);
    --header-height-desktop: 90px;
    --header-height-shrunk: 52px;
    --header-height-mobile: 72px;
    --header-height-mobile-shrunk: 50px;

    /* --- ESPAIAT --- */
    --spacing-section: 8rem 2rem;
    --spacing-section-lg: 12rem 2rem;
    --container-max: 1200px;
    --container-padding: 2rem;

    /* --- BREAKPOINTS (referència, usar en @media) --- */
    /* --bp-mobile: 768px  */
    /* --bp-tablet: 1024px */
}

/* ==========================================================================
   RESET
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   BASE ELEMENTS
   ========================================================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-body);
    background-color: var(--color-cream);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* ==========================================================================
   ACCESSIBILITY - FOCUS INDICATORS
   ========================================================================== */

/* Focus indicators for keyboard navigation */
*:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Remove default focus for mouse users, keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Enhanced focus for interactive elements */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Focus for radio buttons and checkboxes */
input[type="radio"]:focus-visible,
input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: inherit;
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ==========================================================================
   GENERIC TEST CARD ILLUSTRATIONS
   ========================================================================== */

.test-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background-color: var(--color-white, #fff);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.test-card::before {
    content: '';
    display: block;
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, rgba(232, 125, 82, 0.16), rgba(255, 255, 255, 0.02));
}

.test-card::after {
    content: '';
    position: absolute;
    top: 22px;
    right: 22px;
    width: 96px;
    height: 96px;
    border-radius: 24px;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.88), transparent 42%),
                radial-gradient(circle at 70% 70%, rgba(232, 125, 82, 0.22), transparent 48%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.test-card .test-card__content,
.test-card .card__content,
.test-card .card-content {
    position: relative;
    z-index: 1;
    padding-top: 1.5rem;
}

.test-card .test-card__title,
.test-card .card__title,
.test-card .card-title {
    margin-top: 1rem;
}

.test-card .test-card__meta,
.test-card .card__meta,
.test-card .card-meta,
.test-card .test-card__description,
.test-card .card__description,
.test-card .card-description {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   GENERIC FORM STYLING
   ========================================================================== */

.contact-form,
.site-form,
form {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--color-white, #fff);
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.07);
    display: grid;
    gap: 1rem;
}

.contact-form label,
.site-form label,
form label {
    display: block;
    font-weight: 600;
    color: var(--color-dark-grey, #333);
    margin-bottom: 0.5rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select,
.site-form input,
.site-form textarea,
.site-form select,
form input,
form textarea,
form select {
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--color-grey-border, #ccc);
    border-radius: 14px;
    background-color: #fff;
    color: var(--color-black-soft, #111);
    font-size: 1rem;
}

.contact-form textarea,
.site-form textarea,
form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form .form-row,
.site-form .form-row,
form .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.contact-form button,
.site-form button,
form button {
    width: fit-content;
    padding: 1rem 1.8rem;
    border-radius: 999px;
}

.contact-form .form-actions,
.site-form .form-actions,
form .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

@media (max-width: 768px) {
    .contact-form,
    .site-form,
    form {
        padding: 1.5rem;
    }

    .contact-form .form-row,
    .site-form .form-row,
    form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   TEST SLIDE / CARD ILLUSTRATION STYLES
   ========================================================================== */

.slides,
.slider,
.carousel,
.test-slider {
    display: grid;
    gap: 1.5rem;
}

.slide,
.slider__item,
.carousel__item,
.test-card,
.test-slide {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background-color: var(--color-white, #fff);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
    min-height: 280px;
}

.slide::before,
.slider__item::before,
.carousel__item::before,
.test-card::before,
.test-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(232, 125, 82, 0.14), transparent 28%),
                radial-gradient(circle at 75% 20%, rgba(63, 109, 150, 0.08), transparent 32%),
                linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.92));
    pointer-events: none;
}

.slide .slide-title,
.slider__item .slide-title,
.carousel__item .slide-title,
.test-card .test-card__title,
.test-slide .test-title {
    position: relative;
    z-index: 1;
}

.slide .slide-image,
.slider__item .slide-image,
.carousel__item .slide-image,
.test-card .test-card__image,
.test-slide .test-image,
.card .card__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 180px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    object-fit: cover;
    background: radial-gradient(circle at 20% 20%, rgba(232, 125, 82, 0.3), transparent 24%),
                radial-gradient(circle at 80% 70%, rgba(84, 125, 186, 0.18), transparent 30%);
}

@media (max-width: 768px) {
    .slide,
    .slider__item,
    .carousel__item,
    .test-card,
    .test-slide,
    .card {
        min-height: 220px;
    }
}
