/* ===================================
   Salud Mental España - Estilos Principales
   Paleta: Azul calma → Violeta serenidad + Verde esperanza
   =================================== */

/* ============ FUENTES ============ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Libre+Franklin:wght@300;400;500;600;700&family=PT+Mono&display=swap');

/* ============ RESET & BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --azul-calma: #5C6BC0;
    --violeta-serenidad: #7E57C2;
    --verde-esperanza: #66BB6A;
    --gris-suave: #90A4AE;
    --blanco-calido: #FFF8E1;
    --blanco-puro: #FFFFFF;
    --texto-oscuro: #2C3E50;
    --texto-medio: #546E7A;
    
    /* Tipografía */
    --font-titulo: 'Playfair Display', serif;
    --font-cuerpo: 'Libre Franklin', sans-serif;
    --font-label: 'PT Mono', monospace;
    
    /* Tamaños */
    --size-title: 44px;
    --size-body: 18px;
    --size-caption: 15px;
    --line-height: 1.85;
    
    /* Anchos */
    --width-wide: 1180px;
    --width-medium: 900px;
    --width-compact: 700px;
    
    /* Hero */
    --hero-height: 86vh;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-cuerpo);
    font-size: var(--size-body);
    line-height: var(--line-height);
    color: var(--texto-oscuro);
    background: var(--blanco-calido);
    overflow-x: hidden;
}

/* ============ TIPOGRAFÍA ============ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-titulo);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.2rem;
    color: var(--violeta-serenidad);
}

h1 {
    font-size: var(--size-title);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 38px;
    margin-bottom: 1.3rem;
}

h3 {
    font-size: 32px;
    margin-bottom: 1rem;
}

h4 {
    font-size: 26px;
}

p {
    margin-bottom: 1.5rem;
    color: var(--texto-medio);
}

a {
    color: var(--azul-calma);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--violeta-serenidad);
}

label {
    font-family: var(--font-label);
    font-size: var(--size-caption);
    color: var(--texto-medio);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

/* ============ HEADER & NAVEGACIÓN ============ */
header {
    background: linear-gradient(135deg, var(--azul-calma) 0%, var(--violeta-serenidad) 100%);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(92, 107, 192, 0.2);
}

.header-container {
    max-width: var(--width-wide);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-titulo);
    font-size: 28px;
    font-weight: 700;
    color: var(--blanco-puro);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 32px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--blanco-puro);
    font-weight: 500;
    font-size: 16px;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
    background: rgba(255, 255, 255, 0.15);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--blanco-puro);
    font-size: 28px;
    cursor: pointer;
}

/* ============ HERO SECTION ============ */
.hero {
    height: var(--hero-height);
    background: linear-gradient(135deg, var(--azul-calma) 0%, var(--violeta-serenidad) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: var(--width-medium);
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: var(--blanco-puro);
    font-size: 56px;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero p {
    color: var(--blanco-calido);
    font-size: 22px;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-subtitle {
    font-family: var(--font-label);
    font-size: var(--size-caption);
    color: var(--verde-esperanza);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ============ BOTONES ============ */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
    font-family: var(--font-cuerpo);
}

.btn-primary {
    background: var(--verde-esperanza);
    color: var(--blanco-puro);
    box-shadow: 0 4px 15px rgba(102, 187, 106, 0.3);
}

.btn-primary:hover {
    background: #57AB5A;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 187, 106, 0.4);
}

.btn-secondary {
    background: var(--blanco-puro);
    color: var(--violeta-serenidad);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--blanco-calido);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--blanco-puro);
    border: 2px solid var(--blanco-puro);
}

.btn-outline:hover {
    background: var(--blanco-puro);
    color: var(--violeta-serenidad);
}

.btn-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ============ SECCIONES ============ */
section {
    padding: 5rem 2rem;
}

.section-wide {
    max-width: var(--width-wide);
    margin: 0 auto;
}

.section-medium {
    max-width: var(--width-medium);
    margin: 0 auto;
}

.section-compact {
    max-width: var(--width-compact);
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-subtitle {
    font-family: var(--font-label);
    font-size: var(--size-caption);
    color: var(--verde-esperanza);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

/* ============ GRID DE RECURSOS ============ */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.resource-card {
    background: var(--blanco-puro);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-top: 4px solid var(--azul-calma);
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(92, 107, 192, 0.15);
}

.resource-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    color: var(--violeta-serenidad);
}

.resource-card h3 {
    font-size: 24px;
    margin-bottom: 1rem;
    color: var(--violeta-serenidad);
}

.resource-card p {
    color: var(--texto-medio);
    font-size: 16px;
    margin-bottom: 1.5rem;
}

.resource-meta {
    font-family: var(--font-label);
    font-size: 13px;
    color: var(--gris-suave);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(144, 164, 174, 0.2);
}

/* ============ LÍNEAS DE AYUDA DESTACADAS ============ */
.helpline-highlight {
    background: linear-gradient(135deg, var(--verde-esperanza) 0%, #57AB5A 100%);
    border-radius: 16px;
    padding: 3rem;
    margin: 3rem 0;
    color: var(--blanco-puro);
    text-align: center;
}

.helpline-highlight h2 {
    color: var(--blanco-puro);
    margin-bottom: 2rem;
}

.helpline-numbers {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.helpline-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    min-width: 250px;
}

.helpline-item h3 {
    color: var(--blanco-puro);
    font-size: 20px;
    margin-bottom: 0.5rem;
}

.helpline-number {
    font-family: var(--font-label);
    font-size: 28px;
    font-weight: 700;
    color: var(--blanco-puro);
    margin: 0.5rem 0;
}

.helpline-hours {
    font-size: 14px;
    color: var(--blanco-calido);
    margin-top: 0.5rem;
}

/* ============ BUSCADOR DE RECURSOS ============ */
.resource-finder {
    background: var(--blanco-puro);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
}

.search-box {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gris-suave);
    border-radius: 50px;
    font-size: 16px;
    font-family: var(--font-cuerpo);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--azul-calma);
    box-shadow: 0 0 0 4px rgba(92, 107, 192, 0.1);
}

.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.7rem 1.5rem;
    background: var(--blanco-calido);
    border: 2px solid transparent;
    border-radius: 50px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-cuerpo);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--azul-calma);
    color: var(--blanco-puro);
    border-color: var(--azul-calma);
}

/* ============ LISTA DE RECURSOS ============ */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.resource-item {
    background: var(--blanco-puro);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    border-left: 5px solid var(--verde-esperanza);
    transition: all 0.3s ease;
}

.resource-item:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateX(5px);
}

.resource-item h4 {
    color: var(--violeta-serenidad);
    font-size: 22px;
    margin-bottom: 0.8rem;
}

.resource-item .location {
    font-family: var(--font-label);
    font-size: 13px;
    color: var(--gris-suave);
    margin-bottom: 1rem;
}

.resource-item .contact {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--texto-medio);
    font-size: 16px;
}

.contact-icon {
    color: var(--azul-calma);
}

/* ============ FORMULARIO ============ */
.form-container {
    background: var(--blanco-puro);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: var(--width-compact);
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gris-suave);
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-cuerpo);
    transition: all 0.3s ease;
    background: var(--blanco-calido);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--azul-calma);
    box-shadow: 0 0 0 4px rgba(92, 107, 192, 0.1);
    background: var(--blanco-puro);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.3rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-group label {
    font-family: var(--font-cuerpo);
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.6;
}

/* ============ ALERTAS Y MENSAJES ============ */
.alert {
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-left: 5px solid;
}

.alert-info {
    background: rgba(92, 107, 192, 0.1);
    border-color: var(--azul-calma);
    color: var(--texto-oscuro);
}

.alert-success {
    background: rgba(102, 187, 106, 0.1);
    border-color: var(--verde-esperanza);
    color: var(--texto-oscuro);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: #FFC107;
    color: var(--texto-oscuro);
}

.alert-emergency {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: var(--blanco-puro);
    border: none;
    text-align: center;
    font-size: 20px;
    padding: 2rem;
}

.alert-emergency h3 {
    color: var(--blanco-puro);
    font-size: 28px;
    margin-bottom: 1rem;
}

/* ============ TABLAS ============ */
.info-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--blanco-puro);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    margin: 2rem 0;
}

.info-table th,
.info-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(144, 164, 174, 0.2);
}

.info-table th {
    background: var(--azul-calma);
    color: var(--blanco-puro);
    font-weight: 600;
    font-size: 16px;
}

.info-table tr:hover {
    background: var(--blanco-calido);
}

/* ============ FOOTER ============ */
footer {
    background: linear-gradient(135deg, var(--violeta-serenidad) 0%, var(--azul-calma) 100%);
    color: var(--blanco-puro);
    padding: 4rem 2rem 2rem;
    margin-top: 5rem;
}

.footer-container {
    max-width: var(--width-wide);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--blanco-puro);
    font-size: 20px;
    margin-bottom: 1.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: var(--blanco-calido);
    font-size: 16px;
}

.footer-section a:hover {
    color: var(--blanco-puro);
}

.footer-contact p {
    color: var(--blanco-calido);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
    text-align: center;
    color: var(--blanco-calido);
    font-size: 14px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    :root {
        --size-title: 36px;
        --size-body: 16px;
        --hero-height: 70vh;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .nav-toggle {
        display: block;
    }
    
    nav {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    nav.active {
        max-height: 500px;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
    }
    
    nav a {
        display: block;
        width: 100%;
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 42px;
    }
    
    .hero p {
        font-size: 18px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .helpline-numbers {
        flex-direction: column;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .form-container {
        padding: 2rem 1.5rem;
    }
    
    section {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 24px;
    }
    
    .logo {
        font-size: 22px;
    }
}

/* ============ COOKIE BANNER ============ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--violeta-serenidad) 0%, var(--azul-calma) 100%);
    color: var(--blanco-puro);
    padding: 1.5rem 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    animation: slideUp 0.5s ease-out;
}

.cookie-banner.hidden {
    display: none;
}

.cookie-banner-content {
    flex: 1;
    min-width: 300px;
}

.cookie-banner-content p {
    margin: 0;
    color: var(--blanco-calido);
    font-size: 15px;
    line-height: 1.6;
}

.cookie-banner-content a {
    color: var(--blanco-puro);
    text-decoration: underline;
    font-weight: 600;
}

.cookie-banner-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-cuerpo);
}

.cookie-btn-accept {
    background: var(--verde-esperanza);
    color: var(--blanco-puro);
}

.cookie-btn-accept:hover {
    background: #57AB5A;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 187, 106, 0.4);
}

.cookie-btn-reject {
    background: transparent;
    color: var(--blanco-puro);
    border: 2px solid var(--blanco-puro);
}

.cookie-btn-reject:hover {
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1.2rem 1.5rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-banner-content {
        min-width: 100%;
        text-align: center;
    }
    
    .cookie-banner-content p {
        font-size: 14px;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============ UTILIDADES ============ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
