/* =============================================================================
   Portal GVE — Valor y Gestion
   Paleta y lenguaje visual portados del gve-reportes-kit (login.css) para que
   el portal, los reportes y el resto de la suite se vean como un solo producto.
   ============================================================================= */

:root {
    --ink-900: #0E2138;
    --ink-800: #1A2F4A;
    --ink-700: #2E4361;
    --ink-500: #5E6A7C;
    --ink-400: #8B95A4;
    --ink-300: #C9CFD8;
    --ink-200: #DDE2EA;
    --ink-100: #ECEEF1;
    --ink-50:  #F7F8FA;

    --canvas:  #F5F4F0;
    --surface: #FFFFFF;

    --accent:      #E0822A;
    --accent-deep: #B5651B;
    --brand-gold:  #D4A847;

    --crit: #A23B2B;
    --crit-soft: #F3DDD7;

    --radius:    6px;
    --radius-md: 8px;
    --shadow-card: 0 6px 24px rgba(14, 33, 56, 0.10), 0 1px 2px rgba(14, 33, 56, 0.05);

    --font-sans: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--font-sans);
    color: var(--ink-900);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* =============================================================================
   LOGIN — split brand + card (idéntico al reportes-kit)
   ============================================================================= */

.login-split {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
    min-height: 100dvh; /* altura real del viewport en mobile Safari */
}

.login-brand {
    position: relative;
    background:
        radial-gradient(circle at 25% 30%, rgba(224, 130, 42, 0.18), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(212, 168, 71, 0.10), transparent 50%),
        linear-gradient(135deg, #031B38 0%, #0E2138 45%, #1A2F4A 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}
.login-brand::before,
.login-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    pointer-events: none;
}
.login-brand::before { width: 340px; height: 340px; top: -80px;  left: -110px; }
.login-brand::after  { width: 260px; height: 260px; bottom: -70px; right: -90px; }

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
    text-align: left;
}
.login-brand-logo {
    display: block;
    max-width: 220px;
    height: auto;
    margin-bottom: 28px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.login-brand-title {
    margin: 0 0 10px;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #fff;
}
.login-brand-sub {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--brand-gold);
    letter-spacing: 0.02em;
    max-width: 380px;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--canvas);
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 420px;
    padding: 40px 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    margin-bottom: 4px;
}
.login-card-logo {
    max-width: 84px;
    height: auto;
    margin-bottom: 12px;
    display: none; /* redundante con la izquierda; se muestra en mobile */
}
.login-card-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}
.login-card-header p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ink-500);
    line-height: 1.4;
}

.login-error {
    background: var(--crit-soft);
    color: var(--crit);
    border: 1px solid rgba(162, 59, 43, 0.25);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.login-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-700);
    letter-spacing: 0.02em;
}
.login-field input {
    font: inherit;
    font-size: 14px;
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-300);
    border-radius: var(--radius);
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
}
.login-field input:focus {
    border-color: var(--ink-700);
    box-shadow: 0 0 0 3px rgba(46, 67, 97, 0.12);
}

.login-field-pass { position: relative; }
.login-field-pass input { padding-right: 42px; }
.login-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--ink-400);
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.login-eye:hover { color: var(--ink-700); background: var(--ink-50); }
.login-eye svg { width: 18px; height: 18px; }

.login-submit {
    margin-top: 6px;
    background: var(--ink-900);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px 16px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    width: 100%;
}
.login-submit:hover  { background: var(--ink-800); }
.login-submit:active { transform: translateY(1px); }

.login-hint {
    margin: 8px 0 0;
    font-size: 11.5px;
    color: var(--ink-500);
    text-align: center;
    line-height: 1.4;
}

/* =============================================================================
   LANDING — split brand (misma identidad del login) + apps en vertical
   ============================================================================= */

.portal-split {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

.portal-brand {
    position: relative;
    background:
        radial-gradient(circle at 25% 30%, rgba(224, 130, 42, 0.18), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(212, 168, 71, 0.10), transparent 50%),
        linear-gradient(135deg, #031B38 0%, #0E2138 45%, #1A2F4A 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}
.portal-brand::before,
.portal-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    pointer-events: none;
}
.portal-brand::before { width: 340px; height: 340px; top: -80px;  left: -110px; }
.portal-brand::after  { width: 260px; height: 260px; bottom: -70px; right: -90px; }

.portal-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
    text-align: left;
}
.portal-brand-logo {
    display: block;
    max-width: 220px;
    height: auto;
    margin-bottom: 28px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}
.portal-brand-title {
    margin: 0 0 10px;
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #fff;
}
.portal-brand-sub {
    margin: 0 0 36px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--brand-gold);
    letter-spacing: 0.02em;
    max-width: 380px;
}

.portal-brand-user {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    max-width: 300px;
}
.portal-brand-user-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}
.portal-brand-user strong {
    font-size: 15px;
    color: #fff;
}
.portal-brand-user-org {
    font-size: 12.5px;
    color: var(--brand-gold);
}

.portal-brand-logout button {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: var(--radius);
    color: rgba(255,255,255,0.85);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.portal-brand-logout button:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.55);
}

/* --- Derecha: lista vertical de aplicaciones --- */
.portal-apps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: var(--canvas);
}
.portal-apps-inner {
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.portal-apps-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink-900);
}
.portal-apps-sub {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: var(--ink-500);
}

.portal-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
/* Barra accent al costado izquierdo que se despliega al hover */
.portal-row::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--accent), var(--brand-gold));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.22s ease;
}
.portal-row:hover {
    transform: translateX(4px);
    box-shadow: 0 10px 28px rgba(14, 33, 56, 0.14), 0 2px 4px rgba(14, 33, 56, 0.06);
    border-color: rgba(224, 130, 42, 0.45);
}
.portal-row:hover::before { transform: scaleY(1); }

.portal-row-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-deep);
    background: linear-gradient(135deg, rgba(224,130,42,0.13), rgba(212,168,71,0.09));
    border: 1px solid rgba(224, 130, 42, 0.22);
    transition: transform 0.16s ease;
}
.portal-row-icon svg { width: 26px; height: 26px; }
.portal-row:hover .portal-row-icon { transform: scale(1.06); }

.portal-row-text {
    flex: 1;
    min-width: 0;
}
.portal-row-text h3 {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}
.portal-row-text p {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-500);
    line-height: 1.4;
}

.portal-row-arrow {
    flex-shrink: 0;
    font-size: 18px;
    color: var(--ink-300);
    transition: transform 0.16s ease, color 0.16s ease;
}
.portal-row:hover .portal-row-arrow {
    color: var(--accent-deep);
    transform: translateX(3px);
}

.portal-apps-footer {
    margin: 14px 0 0;
    text-align: center;
    font-size: 11px;
    color: var(--ink-400);
    letter-spacing: 0.03em;
}

/* =============================================================================
   Responsive (mismos breakpoints que el reportes-kit)
   ============================================================================= */

@media (max-width: 860px) {
    .login-split {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    .login-brand { display: none; }
    .login-panel { padding: 24px 16px; }
    .login-card  { padding: 28px 24px 24px; }
    .login-card-logo { display: block; }

    /* iOS Safari auto-zoomea con font-size < 16px en inputs */
    .login-field input { font-size: 16px; }
    .login-eye { padding: 10px; right: 4px; }
    .login-field-pass input { padding-right: 48px; }

    /* Landing: el brand pasa a ser header superior compacto */
    .portal-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .portal-brand {
        padding: 20px 16px;
        align-items: flex-start;
        justify-content: flex-start;
    }
    .portal-brand-inner {
        max-width: none;
        width: 100%;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo  logout"
            "user  user";
        gap: 12px;
        align-items: center;
    }
    .portal-brand-logo  { grid-area: logo; max-width: 140px; margin: 0; }
    .portal-brand-title { display: none; }
    .portal-brand-sub   { display: none; }
    .portal-brand-user {
        grid-area: user;
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
        padding: 8px 12px;
        margin: 0;
        max-width: none;
    }
    .portal-brand-user-label { display: none; }
    .portal-brand-logout { grid-area: logout; }

    .portal-apps { padding: 24px 16px 40px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .login-panel          { padding: 16px 12px; }
    .login-card           { padding: 24px 20px 20px; border-radius: 10px; }
    .login-card-header h2 { font-size: 22px; }
    .login-card-logo      { max-width: 68px; margin-bottom: 8px; }
    .login-submit         { min-height: 46px; }
    .login-hint           { font-size: 11px; }

    .portal-apps-title { font-size: 20px; }
    .portal-row        { padding: 14px 14px; gap: 12px; }
    .portal-row-icon   { width: 44px; height: 44px; border-radius: 12px; }
    .portal-row-icon svg { width: 22px; height: 22px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .login-panel {
        align-items: flex-start;
        padding: 16px;
        overflow-y: auto;
    }
    .login-card {
        padding: 18px 20px 14px;
        gap: 12px;
        margin: auto 0;
    }
    .login-card-header    { margin-bottom: 0; }
    .login-card-header h2 { font-size: 20px; }
    .login-card-logo      { max-width: 56px; margin-bottom: 4px; }
    .login-hint           { font-size: 10.5px; margin-top: 4px; }
}
