/* ===============================
   PALETA Y BASE
   =============================== */

:root {
    --color-azul: #2D5F73;
    --color-verde-salvia: #A6C3B4;
    --color-beige: #F4E9DC;
    --color-gris-azulado: #E0ECF2;
    --color-texto: #333333;
    --color-blanco: #FFFFFF;
    --color-error: #ff4b4b;
    --color-error-strong: #d90000;

    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-texto);
    background: var(--color-beige);
}

p {
    text-align: justify;
}

/* Contenedor global */

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===============================
   HEADER
   =============================== */

.site-header {
    position: static;
    z-index: 50;
    background: rgba(244, 233, 220, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0;
}

.logo-name {
    font-weight: 600;
    color: var(--color-azul);
    font-size: 1.1rem;
    display: block;
}

.logo-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-logo {
    height: 150px;
    width: auto;
    display: block;
}

.main-nav {
    display: flex;
    gap: 18px;
    align-items: center;
}

.main-nav a {
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--color-texto);
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.main-nav a:hover {
    color: var(--color-azul);
    opacity: 1;
}

/* ===============================
   BOTONES
   =============================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-azul);
    color: var(--color-blanco);
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(45, 95, 115, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--color-azul);
    border: 1px solid rgba(45, 95, 115, 0.25);
}

.btn-secondary:hover {
    background: rgba(45, 95, 115, 0.05);
}

.btn-outline {
    background: transparent;
    color: var(--color-azul);
    border: 1px solid rgba(45, 95, 115, 0.35);
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn-light {
    background: var(--color-blanco);
    color: var(--color-azul);
    box-shadow: var(--shadow-soft);
}

.btn-light:hover {
    transform: translateY(-1px);
}

.btn-outline-light {
    background: transparent;
    color: var(--color-blanco);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===============================
   SECCIONES GENERALES
   =============================== */

.section {
    padding: 64px 0;
}

.section-soft {
    padding: 64px 0;
    background: var(--color-gris-azulado);
}

.section-soft-alt {
    padding: 64px 0;
    background: var(--color-verde-salvia);
}

.section-title {
    font-size: 1.9rem;
    margin: 0 0 16px;
    color: var(--color-azul);
}

.section-intro {
    max-width: 640px;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Links */

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--color-azul);
    font-weight: 500;
    margin-top: 16px;
}

.link-arrow:hover {
    text-decoration: underline;
}

.link-muted {
    font-size: 0.9rem;
    opacity: 0.7;
}

.section-link {
    margin-top: 24px;
}

/* ===============================
   HERO
   =============================== */

.hero {
    padding: 80px 0 64px;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}

.hero-kicker {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-azul);
    margin-bottom: 8px;
}

.hero-title {
    font-size: clamp(2.3rem, 4vw, 3rem);
    margin: 0 0 12px;
    color: var(--color-azul);
}

.hero-subtitle {
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 20px;
    max-width: 560px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-note {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Foto hero */

.hero-photo {
    display: flex;
    justify-content: flex-end;
}

.photo-card {
    background: var(--color-gris-azulado);
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-soft);
}

.photo-card.small {
    max-width: 260px;
}

.photo-placeholder {
    width: 100%;
    min-height: 220px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #cfdde4, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7a86;
    font-size: 0.95rem;
    font-weight: 500;
}

.photo-caption {
    margin: 10px 4px 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* ===============================
   CARDS / GRIDS
   =============================== */

.cards-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.card {
    background: var(--color-blanco);
    border-radius: var(--radius-lg);
    padding: 18px 18px 20px;
    box-shadow: var(--shadow-soft);
}

.card h3 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--color-azul);
}

.card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
}

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

.service-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-modalidad {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-azul);
}

/* ===============================
   SOBRE MÍ
   =============================== */

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    gap: 40px;
    align-items: center;
}

.about-text p {
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.7;
}

.about-photo .photo-placeholder {
    min-height: 100%;
    height: 100%;
}

.photo-img-about {
    transform: scale(1.22);
    transform-origin: center 40%;
}

/* ===============================
   EXPERIENCIA
   =============================== */

.experience-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.experience-item {
    background: var(--color-blanco);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-soft);
}

.experience-item h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: var(--color-azul);
}

.experience-item p {
    margin: 0;
    font-size: 0.95rem;
}

/* ===============================
   GALERÍA
   =============================== */

.gallery-grid {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background: #d8e6ed;
}

.gallery-image-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    will-change: opacity;
}

.gallery-image-primary {
    opacity: 1;
}

.gallery-image-next {
    opacity: 0;
    transition: opacity 0.7s ease;
}

.gallery-item.is-fading .gallery-image-next {
    opacity: 1;
}

.gallery-item.is-fading .gallery-image-primary {
    opacity: 0;
    transition: opacity 0.7s ease;
}

.gallery-placeholder {
    background: linear-gradient(135deg, #cfdde4, #dbece5);
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #4b5a63;
}

/* ===============================
   DIPLOMA
   =============================== */

.diploma-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}

.diploma-text p {
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.7;
}

.diploma-numero {
    font-weight: 500;
}

.diploma-image {
    width: min(100%, 300px);
    min-height: 220px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    margin: 0 auto;
}

.diploma-img {
    width: 100%;
    height: 100%;
    aspect-ratio: 20 / 27;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ===============================
   CONTACTO / CTA
   =============================== */

.section-cta {
    background: var(--color-azul);
    color: var(--color-blanco);
}

.cta-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr);
    gap: 32px;
    align-items: flex-start;
}

.cta-text h2 {
    margin: 0 0 12px;
    font-size: 1.8rem;
}

.cta-text p {
    margin: 0 0 16px;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Formulario */

.contact-form {
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 18px 18px 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
}

.field {
    margin-bottom: 12px;
}

.field label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.field input,
.field textarea {
    width: 100%;
    border-radius: 999px;
    border: none;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.field textarea {
    border-radius: 14px;
    resize: vertical;
    min-height: 90px;
}

.field-error {
    min-height: 18px;
    margin: 6px 2px 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: #ffe1e1;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.is-invalid {
    box-shadow: 0 0 0 3px rgba(217, 0, 0, 0.72);
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-status {
    min-height: 22px;
    margin: 10px 0 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-status.is-success {
    color: #d6ffe4;
}

.form-status.is-error {
    color: var(--color-error);
    font-weight: 700;
}

.success-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
}

.success-modal.is-open {
    display: grid;
    place-items: center;
}

.success-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 32, 40, 0.58);
    backdrop-filter: blur(2px);
}

.success-modal__dialog {
    position: relative;
    width: min(92vw, 520px);
    border-radius: 20px;
    background: linear-gradient(165deg, #f8efe4 0%, #edf5f8 100%);
    border: 2px solid rgba(45, 95, 115, 0.3);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.25);
    padding: 26px 22px 22px;
    text-align: center;
    animation: modalPop 0.28s ease-out;
}

.success-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: var(--color-azul);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.success-modal__icon {
    width: 64px;
    height: 64px;
    margin: 4px auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 700;
    color: #0b6b2f;
    background: radial-gradient(circle at 30% 30%, #e9ffe8 0%, #bfe8c2 100%);
    border: 2px solid rgba(11, 107, 47, 0.25);
}

.success-modal__title {
    margin: 0 0 10px;
    color: var(--color-azul);
    font-size: 1.45rem;
}

.success-modal__text {
    margin: 0 auto 18px;
    max-width: 44ch;
    text-align: center;
    color: #223a45;
    font-size: 1rem;
    line-height: 1.5;
}

.success-modal__button {
    min-width: 160px;
    border: 0;
    color: var(--color-blanco);
    background: linear-gradient(140deg, #2d5f73 0%, #4d8aa3 100%);
    box-shadow: 0 12px 24px rgba(22, 60, 77, 0.3);
}

.success-modal__button:hover {
    transform: translateY(-1px);
}

body.modal-open {
    overflow: hidden;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.form-note {
    margin-top: 8px;
    font-size: 0.8rem;
    opacity: 0.8;
}

.form-note a {
    color: var(--color-blanco);
    font-weight: 500;
}

.consent-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0 12px;
}

.consent-box input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-verde-salvia);
    cursor: pointer;
    flex-shrink: 0;
}

.consent-box input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-verde-salvia);
    outline-offset: 2px;
}

.consent-box label {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
}

.consent-box a {
    color: var(--color-blanco);
    font-weight: 500;
}

/* ===============================
   FOOTER
   =============================== */

.site-footer {
    padding: 20px 0 24px;
    background: #f1e4d3;
}

.footer-inner {
    text-align: center;
    font-size: 0.9rem;
}

.footer-legal {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.footer-legal a {
    color: var(--color-azul);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-legal a:hover {
    text-decoration: underline;
}

.footer-secondary {
    margin-top: 6px;
    opacity: 0.7;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    background: var(--color-azul);
    color: var(--color-blanco);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    z-index: 60;
}

.back-to-top:hover {
    background: #244f60;
    transform: translateY(6px);
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}


.photo-card {
    width: 280px;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Botón hamburguesa (oculto en escritorio) */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
    /* en dark.css cámbialo a blanco suave */
    margin: 4px 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Animación simple al abrir */
body.nav-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ===============================
   LEGALES
   =============================== */

.legal-main {
    padding: 56px 0 72px;
}

.legal-shell {
    background: var(--color-blanco);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 28px 28px 32px;
}

.legal-eyebrow {
    margin: 0 0 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-azul);
    font-weight: 600;
}

.legal-title {
    margin: 0 0 8px;
    color: var(--color-azul);
    font-size: 1.9rem;
}

.legal-updated {
    margin: 0 0 22px;
    font-size: 0.9rem;
    opacity: 0.75;
}

.legal-section+.legal-section {
    margin-top: 22px;
}

.legal-section h2 {
    margin: 0 0 8px;
    color: var(--color-azul);
    font-size: 1.2rem;
}

.legal-section p {
    margin: 0;
    line-height: 1.65;
}

.legal-list {
    margin: 10px 0 0;
    padding-left: 20px;
}

.legal-list li+li {
    margin-top: 8px;
}

.legal-highlight {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--color-gris-azulado);
}

.legal-contact {
    margin-top: 22px;
    border-radius: var(--radius-md);
    background: rgba(166, 195, 180, 0.24);
    padding: 14px 16px;
}

.legal-contact p+p {
    margin-top: 6px;
}

.legal-link {
    color: var(--color-azul);
}

.legal-back {
    margin-top: 24px;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 768px) {

    .photo-card {
        width: 220px;
        height: 280px;
        margin: 0 auto 16px;
    }

    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }

    .brand-logo {
        height: 150px;
    }

    .photo-img-about {
        transform: scale(1.14);
    }

    .nav-toggle {
        display: block;
    }

    /* Header más compacto */
    .header-inner {
        justify-content: space-between;
    }

    /* El menú pasa a ser un panel desplegable */
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 14px 20px 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        background: rgba(244, 233, 220, 0.98);
        /* en dark.css pon un fondo oscuro */
        /* estado cerrado */
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    /* Versión dark (solo en dark.css, sobreescribe el background arriba) */
    /* .main-nav { background: rgba(5,9,11,0.98); } */

    .main-nav a {
        font-size: 0.95rem;
    }

    .main-nav .nav-cta {
        align-self: center;
    }

    /* Cuando el body tiene nav-open, mostramos el menú */
    body.nav-open .main-nav {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .header-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-inner,
    .about-grid,
    .diploma-grid,
    .cta-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero {
        padding-top: 60px;
    }

    .hero-photo {
        justify-content: center;
    }

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

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

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

    .legal-main {
        padding: 40px 0 56px;
    }

    .legal-shell {
        padding: 22px 18px 24px;
    }

    .legal-title {
        font-size: 1.55rem;
    }
}

@media (max-width: 600px) {

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

    .header-inner {
        gap: 12px;
    }

    .footer-legal {
        flex-direction: column;
        gap: 8px;
    }

    .consent-box {
        gap: 8px;
    }

    .consent-box label {
        font-size: 0.83rem;
    }
}
