
/* ============================================================
   ATRAM GESTIÓN API
   WEB CORPORATIVA
   ============================================================ */

:root {
    --primary: #991104;
    --primary-hover: #b51a0d;

    --secondary: #737276;
    --border: #d1d1d1;

    --bg: #f6f6f7;
    --surface: #ffffff;
    --surface-alt: #f0f0f1;

    --text: #292929;
    --text-secondary: #6d6c6e;

    --header-bg: #ffffff;

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}


/* ============================================================
   MODO OSCURO
   ============================================================ */

html[data-theme="dark"] {
    --primary: #b51a0d;
    --primary-hover: #d42a1c;

    --secondary: #bcbcbc;
    --border: #44484b;

    --bg: #17191b;
    --surface: #202326;
    --surface-alt: #292d30;

    --text: #f2f2f2;
    --text-secondary: #bcbcbc;

    --header-bg: #202326;

    --shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}


/* ============================================================
   BASE
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 110px;
}

@media (max-width: 1050px) {
    html {
        scroll-padding-top: 155px;
    }
}

body {
    margin: 0;

    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg);
    color: var(--text);

    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.container {
    width: 100%;
    max-width: 1220px;

    margin: 0 auto;
    padding: 0 24px;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: var(--header-bg);
    border-bottom: 3px solid var(--primary);

    box-shadow:
        0 1px 5px rgba(0, 0, 0, 0.08);
}


/* CONTENEDOR PRINCIPAL */
.header-content {
    min-height: 88px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;
}


/* LOGOTIPO */
.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo {
    display: block;

    width: 190px;
    max-width: 100%;
    height: auto;
}


/* NAVEGACIÓN */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    gap: 26px;
}

.main-nav a {
    color: var(--text-secondary);

    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;

    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
}


/* ACCIONES DEL HEADER */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 12px;
    flex-shrink: 0;
}


/* BOTÓN SWAGGER */
.swagger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    min-height: 40px;
    padding: 9px 16px;

    border: 1px solid #991104;
    border-radius: 6px;

    background: #991104;
    color: #ffffff;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;

    transition:
        background-color 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.swagger-button:hover {
    background: #b51a0d;
    border-color: #b51a0d;
    color: #ffffff;
}

.swagger-button svg {
    flex-shrink: 0;
}


/* BOTÓN CLARO/OSCURO */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 40px;
    height: 40px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: transparent;
    color: var(--text-secondary);

    font-size: 21px;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--surface-alt);
}


/* ACCESIBILIDAD */
.swagger-button:focus-visible,
.theme-toggle:focus-visible,
.main-nav a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
    padding: 92px 0 100px;

    background:
        linear-gradient(
            135deg,
            var(--surface) 0%,
            var(--bg) 100%
        );

    border-bottom: 1px solid var(--border);
}

.hero-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;

    align-items: center;
    gap: 70px;
}

.eyebrow,
.section-label {
    display: inline-block;

    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.hero h1 {
    margin: 18px 0 20px;

    font-size: clamp(40px, 5vw, 64px);
    font-weight: 700;

    line-height: 1.15;
    letter-spacing: -1.5px;
}

.hero h1 span {
    color: var(--primary);
}

.hero-description {
    max-width: 570px;
    margin-bottom: 32px;

    color: var(--text-secondary);

    font-size: 18px;
    line-height: 1.8;
}

/* BOTONES GENERALES */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    padding: 10px 22px;

    border-radius: 6px;

    font-size: 14px;
    font-weight: 600;

    transition:
        background-color 0.2s,
        transform 0.2s;
}

.button:hover {
    /* transform: translateY(-2px); */
    box-shadow: var(--shadow);
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
}

.button-primary:hover {
    background: var(--primary-hover);
}


/* ============================================================
   DIAGRAMA DE INTEGRACIÓN
   ============================================================ */

.hero-visual {
    display: flex;
    justify-content: center;
}

.integration-diagram {
    width: 100%;
    max-width: 400px;

    padding: 30px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface);
    box-shadow: var(--shadow);
}

.diagram-node {
    padding: 18px 22px;

    border: 1px solid var(--border);
    border-radius: 8px;

    background: var(--surface-alt);

    text-align: center;
    font-size: 15px;
    font-weight: 600;
}

.diagram-primary {
    background: #991104;
    border-color: #991104;
    color: #ffffff;
}

.diagram-connector {
    padding: 8px 0;

    text-align: center;

    color: var(--primary);
    font-size: 26px;
    font-weight: 700;
}


/* ============================================================
   SECCIONES
   ============================================================ */

.section {
    padding: 90px 0;
}

.section-alternate {
    background: var(--surface);
}

.section-heading {
    max-width: 780px;
    margin-bottom: 46px;
}

.section-heading h2 {
    margin: 12px 0 18px;

    font-size: clamp(28px, 3vw, 39px);
    font-weight: 700;

    line-height: 1.25;
    letter-spacing: -0.5px;
}

.section-heading p {
    margin: 0;

    color: var(--text-secondary);
    font-size: 17px;
}


/* ============================================================
   QUÉ ES LA API
   ============================================================ */

.content-panel {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;

    gap: 50px;
    align-items: center;

    padding: 38px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow);
}

.content-panel h3 {
    margin-top: 0;
    font-size: 23px;
}

.content-panel p {
    color: var(--text-secondary);
}

.highlight-box {
    padding: 26px;

    background: var(--surface-alt);

    border-left: 4px solid var(--primary);
    border-radius: 6px;
}

.highlight-box h4 {
    margin: 0 0 12px;
    font-size: 17px;
}

.highlight-box p {
    margin: 0;
    font-size: 14px;
}


/* ============================================================
   FUNCIONALIDADES
   ============================================================ */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 24px;
}

.feature-card {
    position: relative;

    padding: 32px;

    background: var(--bg);

    border: 1px solid var(--border);
    border-radius: 10px;

    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.feature-card:hover {
    /* transform: translateY(-4px); */
    box-shadow: var(--shadow);
}

.feature-number {
    margin-bottom: 22px;

    color: var(--primary);

    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.feature-card h3 {
    margin: 0 0 14px;
    font-size: 20px;
}

.feature-card p {
    margin: 0;

    color: var(--text-secondary);
    font-size: 15px;
}


/* ============================================================
   BENEFICIOS
   ============================================================ */

.benefits-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 28px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;

    gap: 18px;
    padding: 28px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: var(--surface);
}

.benefit-icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border-radius: 50%;

    background: #991104;
    color: #ffffff;

    font-weight: 700;
}

.benefit-item h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.benefit-item p {
    margin: 0;

    color: var(--text-secondary);
    font-size: 15px;
}


/* ============================================================
   CIERRE
   ============================================================ */

.closing-section {
    padding: 75px 0;

    background: var(--surface-alt);
    border-top: 1px solid var(--border);
}

.closing-content {
    max-width: 850px;
    text-align: center;
}

.closing-content h2 {
    margin: 0 0 20px;
    font-size: 32px;
}

.closing-content p {
    color: var(--text-secondary);
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    padding: 24px 0;

    background: var(--header-bg);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    color: var(--text-secondary);
    font-size: 13px;
}


/* ============================================================
   BOTÓN VOLVER ARRIBA
   ============================================================ */
.back-to-top {
    position: fixed;

    right: 28px;
    bottom: 28px;

    z-index: 200;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #991104;
    color: #ffffff;

    border: 1px solid #991104;
    border-radius: 50%;

    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20);

    cursor: pointer;

    opacity: 0;
    visibility: hidden;

    transform: translateY(12px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease,
        background-color 0.2s ease;
}

/* Botón visible al desplazarse */
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover */
.back-to-top:hover {
    background: #b51a0d;
    border-color: #b51a0d;
}

/* Accesibilidad */
.back-to-top:focus-visible {
    outline: 3px solid var(--text);
    outline-offset: 3px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

/* TABLETS Y PANTALLAS MEDIANAS */
@media (max-width: 1050px) {

    .header-content {
        display: grid;
        grid-template-columns: 1fr auto;

        gap: 12px 20px;

        padding-top: 14px;
        padding-bottom: 14px;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2;

        justify-content: center;
        gap: 30px;

        padding-top: 10px;

        border-top: 1px solid var(--border);
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .content-panel {
        grid-template-columns: 1fr;
    }

    .brand-logo {
        width: 170px;
    }
}


/* MÓVILES */
@media (max-width: 650px) {

    .container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .header-content {
        grid-template-columns: minmax(0, 1fr) auto;

        gap: 12px;

        padding-top: 12px;
        padding-bottom: 12px;
    }

    .brand {
        min-width: 0;
    }

    .brand-logo {
        width: 140px;
        max-width: 100%;
    }

    .header-actions {
        gap: 8px;
    }

    .swagger-button {
        min-height: 36px;

        padding: 7px 10px;
        gap: 6px;

        font-size: 12px;
    }

    .swagger-button svg {
        width: 13px;
        height: 13px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 19px;
    }

    .main-nav {
        justify-content: space-between;
        gap: 10px;

        overflow-x: auto;

        padding-top: 12px;
        padding-bottom: 3px;
    }

    .main-nav a {
        font-size: 12px;
    }

    .hero {
        padding: 55px 0;
    }

    .hero-description {
        font-size: 16px;
    }

    .section {
        padding: 60px 0;
    }

    .content-panel {
        padding: 24px;
    }

    .cards-grid,
    .benefits-list {
        grid-template-columns: 1fr;
    }

    .closing-content h2 {
        font-size: 26px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .back-to-top {
        right: 18px;
        bottom: 18px;

        width: 42px;
        height: 42px;
    }
}


/* MÓVILES MUY ESTRECHOS */
@media (max-width: 380px) {

    .brand-logo {
        width: 110px;
    }

    .swagger-button {
        padding: 7px 8px;

        font-size: 11px;
    }

    .header-actions {
        gap: 5px;
    }

    .main-nav {
        justify-content: flex-start;

        gap: 16px;
    }
}


/* REDUCIR ANIMACIONES */
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }

    .back-to-top {
        transition: none;
    }
}
