/* ==========================================================
   REPORTES AsEp
   SOPORTE.CSS
   Página pública de soporte — compatible con Home/Login
   y con los temas Light/Dark.
   ========================================================== */

@import "./components/background.css";
@import "./components/hero.css";

/* ==========================================================
   ESTRUCTURA
   ========================================================== */

html,
body {
    min-height: 100%;
}

body:has(.support-page) {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

body:has(.support-page) .app {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    display: flex;
    flex-direction: column;
    background: transparent;
}

body:has(.support-page) .app-main {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
    background: transparent;
}

body:has(.support-page) .app-footer {
    position: relative;
    z-index: 20;
    flex: 0 0 auto;
}

/* ==========================================================
   SOPORTE DESDE SESIÓN AUTENTICADA
   El layout de soporte es autónomo: no debe heredar la navbar
   global del Dashboard, que contiene otro logo y ocupa su propio
   espacio de navegación.
   ========================================================== */

body:has(.support-page) .app-navbar {
    display: none !important;
}

body:has(.support-page) .support-page img,
body:has(.support-page) .support-page a {
    -webkit-user-drag: none;
}

body:has(.support-page) .support-page img {
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

body:has(.support-page) .support-logo {
    width: 62px !important;
    height: 62px !important;
    max-width: 62px !important;
    max-height: 62px !important;
    object-fit: contain !important;
}

/* ==========================================================
   PÁGINA
   ========================================================== */

.support-page {
    position: relative;
    z-index: 1;
    min-height: auto;
    width: 100%;
    box-sizing: border-box;
    isolation: isolate;
    padding: clamp(.75rem, 1.2vw, 1.1rem) clamp(1rem, 2vw, 1.5rem) 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.support-page .hero-bg,
.support-page .hero-light,
.support-page .hero-noise {
    z-index: -3;
}

.support-page .hero-light {
    z-index: -2;
}

.support-page .hero-noise {
    z-index: -1;
}

/* ==========================================================
   TOPBAR
   ========================================================== */

.support-topbar {
    width: min(100%, 1240px);
    margin: 0 auto clamp(1rem, 2vw, 1.5rem);
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.support-brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
    color: var(--color-heading);
    text-decoration: none;
}

.support-brand:hover {
    color: var(--color-heading);
}

.support-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.08));
}

.support-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.support-brand-title {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.02em;
}

.support-brand-title strong {
    font-weight: 800;
}

.support-brand-subtitle {
    margin-top: .2rem;
    color: var(--color-text-muted);
    font-size: .74rem;
    line-height: 1.3;
    letter-spacing: .03em;
}

.support-top-actions {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.support-theme-switch {
    flex: 0 0 auto;
}

.support-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    padding: .65rem .95rem;
    border: 1px solid var(--color-primary-border);
    border-radius: 12px;
    background: var(--glass-background);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 700;
    box-shadow: var(--glass-shadow);
    transition:
        transform .2s ease,
        color .2s ease,
        border-color .2s ease,
        background .2s ease,
        box-shadow .2s ease;
}

.support-back-link:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
    background: var(--bg-surface);
    transform: translateY(-1px);
}

/* ==========================================================
   CONTENIDO
   ========================================================== */

.support-shell {
    width: min(100%, 1240px);
    margin: 0 auto;
    flex: 0 0 auto;

    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: stretch;
    gap: clamp(1rem, 2.2vw, 2rem);
}

.support-hero,
.support-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid var(--home-hero-border);
    box-shadow: var(--home-hero-shadow);
    backdrop-filter: blur(var(--home-hero-blur));
    -webkit-backdrop-filter: blur(var(--home-hero-blur));
}

.support-hero::before,
.support-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 42%);
}

.support-hero > *,
.support-card > * {
    position: relative;
    z-index: 1;
}

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

.support-hero {
    min-height: 560px;
    padding: clamp(1.6rem, 3vw, 2.7rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--home-hero-background);
}

.support-hero-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: .5rem;
    padding: .45rem .72rem;
    border: 1px solid var(--color-primary-border);
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.support-badge-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(255,255,255,.18);
}

.support-hero h1 {
    max-width: 650px;
    margin: 1.25rem 0 .65rem;
    color: var(--home-title-color);
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.support-hero-text {
    max-width: 620px;
    margin: 0;
    color: var(--color-text-secondary);
    font-size: clamp(.98rem, 1.2vw, 1.06rem);
    line-height: 1.65;
}

.support-features {
    display: grid;
    gap: .85rem;
    margin-top: 2rem;
}

.support-feature {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .82rem .9rem;
    border-radius: 15px;
    border: 1px solid var(--color-primary-border);
    background: color-mix(in srgb, var(--bg-surface) 42%, transparent);
}

.support-feature-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: 0 0 auto;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border: 1px solid var(--color-primary-border);
    font-size: 1rem;
}

.support-feature div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.support-feature strong {
    color: var(--color-heading);
    font-size: .88rem;
    line-height: 1.25;
}

.support-feature span:not(.support-feature-icon) {
    margin-top: .15rem;
    color: var(--color-text-muted);
    font-size: .8rem;
    line-height: 1.4;
}

/* Marca de agua sutil */
.support-hero::after {
    content: "?";
    position: absolute;
    right: -2rem;
    bottom: -3rem;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--color-primary);
    border: 18px solid currentColor;
    opacity: .035;
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    transform: rotate(-10deg);
    pointer-events: none;
}

/* ==========================================================
   CARD DEL FORMULARIO
   ========================================================== */

.support-card {
    align-self: stretch;
    background: var(--glass-background-strong);
}

.support-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: clamp(1.35rem, 2.4vw, 2rem) clamp(1.3rem, 2.7vw, 2.25rem) 1.35rem;
}

.support-card-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 16px;
    color: var(--color-primary);
    background: var(--color-primary-soft);
    border: 1px solid var(--color-primary-border);
    font-size: 1.35rem;
}

.support-eyebrow {
    display: block;
    margin-bottom: .2rem;
    color: var(--color-primary);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
}

.support-card h2 {
    margin: 0;
    color: var(--color-heading);
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.support-card-header p {
    margin: .35rem 0 0;
    color: var(--color-text-muted);
    font-size: .9rem;
    line-height: 1.5;
}

.support-divider {
    height: 1px;
    margin: 0;
    background: var(--border-color);
}

.support-form {
    padding: 1.35rem clamp(1.3rem, 2.7vw, 2.25rem) clamp(1.35rem, 2.4vw, 2rem);
}

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

.support-field {
    min-width: 0;
}

.support-field-full {
    grid-column: 1 / -1;
}

.support-field label {
    display: inline-block;
    margin-bottom: .48rem;
    color: var(--form-label-color);
    font-size: .85rem;
    font-weight: 700;
}

.support-input-wrap {
    position: relative;
}

.support-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 1rem;
    z-index: 2;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color .2s ease;
}

.support-input-wrap input,
.support-input-wrap textarea {
    width: 100%;
    border: 1px solid var(--form-input-border);
    border-radius: 14px;
    background: var(--form-input-background);
    color: var(--form-input-text);
    font: inherit;
    outline: none;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease,
        transform .2s ease;
}

.support-input-wrap input {
    min-height: 52px;
    padding: .75rem 1rem .75rem 2.8rem;
}

.support-input-wrap textarea {
    min-height: 170px;
    padding: .85rem 1rem .85rem 2.8rem;
    resize: vertical;
}

.support-input-wrap textarea + * {
    vertical-align: top;
}

.support-input-wrap input::placeholder,
.support-input-wrap textarea::placeholder {
    color: var(--color-placeholder);
}

.support-input-wrap:focus-within > i {
    color: var(--color-primary);
}

.support-input-wrap input:focus,
.support-input-wrap textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.support-help {
    display: block;
    margin-top: .38rem;
    color: var(--color-text-muted);
    font-size: .77rem;
    line-height: 1.45;
}

.support-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    margin-top: 1.25rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--border-color);
}

.support-secondary-btn,
.support-primary-btn {
    min-height: 46px;
    padding: .7rem 1rem;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    text-decoration: none;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease,
        background .2s ease,
        color .2s ease;
}

.support-secondary-btn {
    border: 1px solid var(--border-primary);
    background: var(--bg-surface);
    color: var(--button-secondary-text);
}

.support-secondary-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary-border);
    transform: translateY(-1px);
}

.support-primary-btn {
    border: 1px solid transparent;
    background: var(--button-primary-gradient);
    color: var(--button-primary-text);
    box-shadow: var(--button-primary-shadow);
    cursor: pointer;
}

.support-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(242,92,42,.22);
}

.support-primary-btn:active,
.support-secondary-btn:active,
.support-back-link:active {
    transform: translateY(0);
}

/* ==========================================================
   TEMA CLARO
   ========================================================== */

[data-theme="light"] .support-hero,
[data-theme="light"] .support-card {
    background: rgba(255,255,255,.44);
    border-color: rgba(148,163,184,.25);
    box-shadow:
        0 20px 48px rgba(51,65,85,.09),
        inset 0 1px 0 rgba(255,255,255,.18);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

[data-theme="light"] .support-feature {
    background: rgba(255,255,255,.55);
}

/* ==========================================================
   TEMA OSCURO
   ========================================================== */

[data-theme="dark"] .support-hero,
[data-theme="dark"] .support-card {
    background: rgba(19,36,66,.64);
    border-color: rgba(96,165,250,.20);
    box-shadow:
        0 20px 48px rgba(0,0,0,.18),
        inset 0 1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

[data-theme="dark"] .support-feature {
    background: rgba(7,20,40,.34);
}

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

@media (max-width: 980px) {
    .support-shell {
        grid-template-columns: 1fr;
    }

    .support-hero {
        min-height: auto;
    }
}

@media (max-width: 700px) {
   .support-page {
        padding: .8rem;
    }

    .support-topbar {
        align-items: flex-start;
    }

    .support-brand-subtitle {
        display: none;
    }

    .support-back-link span {
        display: none;
    }

    .support-back-link {
        width: 42px;
        padding: 0;
    }

    .support-form-grid {
        grid-template-columns: 1fr;
    }

    .support-field-full {
        grid-column: auto;
    }

    .support-form-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .support-secondary-btn,
    .support-primary-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .support-back-link,
    .support-primary-btn,
    .support-secondary-btn,
    .support-input-wrap input,
    .support-input-wrap textarea {
        transition: none;
    }
}

/* ==========================================================
   SOPORTE — CONTENEDOR AUTÓNOMO
   La página /soporte no hereda base.html. Estas reglas
   aseguran que ningún layout global pueda introducir un
   desplazamiento vertical o una zona vacía antes del contenido.
========================================================== */

html:has(.support-standalone-body),
body.support-standalone-body {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

body.support-standalone-body {
    min-height: 100vh;
    height: auto;
    background: var(--bg-main);
}

body.support-standalone-body .support-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: clamp(.8rem, 1.2vw, 1.1rem) clamp(1rem, 2vw, 1.5rem) .75rem;
    box-sizing: border-box;
    isolation: isolate;
    transform: none !important;
}

body.support-standalone-body .support-topbar,
body.support-standalone-body .support-shell,
body.support-standalone-body .support-footer {
    position: relative;
    z-index: 2;
}

body.support-standalone-body .support-topbar {
    flex: 0 0 auto;
}

body.support-standalone-body .support-shell {
    flex: 0 0 auto;
}

body.support-standalone-body .support-footer {
    width: min(100%, 1240px);
    margin: 1rem auto 0;
}

/* El fondo decorativo ocupa toda la página, pero nunca empuja contenido. */
body.support-standalone-body .hero-bg {
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
}

body.support-standalone-body .hero-light,
body.support-standalone-body .hero-noise {
    pointer-events: none;
}

/* ==========================================================
   FOOTER PÚBLICO
========================================================== */

.support-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .65rem;
    min-height: 44px;
    padding: .35rem .5rem;
    color: var(--color-text-muted);
    font-size: .72rem;
    line-height: 1.35;
    text-align: center;
    border-top: 1px solid var(--border-light);
    background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.support-footer-logo {
    width: 27px;
    height: 27px;
    object-fit: contain;
    flex: 0 0 27px;
}

.support-footer-copy {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
}

.support-footer-copy::before {
    content: "";
    width: 1px;
    height: 13px;
    margin-right: .45rem;
    background: var(--border-normal);
}

[data-theme="dark"] .support-footer {
    background: rgba(8, 20, 38, .68);
    border-top-color: rgba(148,163,184,.14);
}

@media (max-width: 700px) {
    .support-footer-copy::before {
        display: none;
    }
}
