/* ========================================
   ALTACORE - Portal de Clientes
   ======================================== */

:root {
    --p-primary: #0c2e3c;
    --p-primary-2: #14505c;
    --p-dark: #071a24;
    --p-accent: #d4a640;
    --p-accent-2: #e8bf5a;
    --p-accent-hover: #c49530;
    --p-bg: #f1f5f9;
    --p-card: #ffffff;
    --p-text: #1e293b;
    --p-muted: #64748b;
    --p-border: #e2e8f0;
    --p-success: #10b981;
    --p-warning: #f59e0b;
    --p-danger: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--p-bg);
    color: var(--p-text);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ============ LOGIN (dos secciones / corporativo) ============ */

.login-split { background: var(--p-bg); }

.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

/* ---- Seccion corporativa (imagen empresarial) ---- */
.auth-side {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, #071a24 0%, #0c2e3c 48%, #14505c 100%);
    color: #f8fafc;
    display: flex;
    align-items: flex-end;
    padding: 3.5rem 3rem;
}
.auth-side__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212,166,64,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212,166,64,0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 32% 30%, #000 5%, transparent 70%);
    mask-image: radial-gradient(ellipse at 32% 30%, #000 5%, transparent 70%);
}
.auth-side__glow {
    position: absolute;
    width: 460px;
    height: 460px;
    right: -150px;
    top: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212,166,64,0.22), transparent 65%);
}
.auth-side__mark {
    position: absolute;
    width: 300px;
    height: 300px;
    right: 5%;
    top: 13%;
    opacity: 0.09;
    transform: rotate(-8deg);
}
.auth-side__skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 210px;
    opacity: 0.85;
}
.auth-side__inner { position: relative; z-index: 2; max-width: 440px; }
.auth-side__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(212,166,64,0.35);
    border-radius: 50px;
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--p-accent-2);
    margin-bottom: 1.5rem;
}
.auth-side__tag .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--p-accent);
    box-shadow: 0 0 0 0 rgba(212,166,64,0.6);
    animation: pulse 2.2s infinite;
}
@keyframes pulse {
    70%  { box-shadow: 0 0 0 9px rgba(212,166,64,0); }
    100% { box-shadow: 0 0 0 0 rgba(212,166,64,0); }
}
.auth-side h2 {
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 0.9rem;
}
.auth-side h2 span {
    background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-side p {
    color: rgba(248,250,252,0.62);
    font-size: 0.95rem;
    max-width: 360px;
}

/* ---- Seccion formulario ---- */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--p-card);
}
.auth-card { width: 100%; max-width: 360px; }

.auth-logo-img {
    display: block;
    width: 210px;
    max-width: 64%;
    height: auto;
    margin-bottom: 1.1rem;
}
.auth-cap {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--p-muted);
    margin-bottom: 2rem;
    padding-bottom: 1.3rem;
    border-bottom: 1px solid var(--p-border);
}

/* ---- Campos ---- */
.field { margin-bottom: 0.9rem; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .lead-ico {
    position: absolute;
    left: 0.9rem;
    width: 18px;
    height: 18px;
    color: var(--p-muted);
    opacity: 0.65;
    pointer-events: none;
    transition: color .18s, opacity .18s;
}
.input-wrap:focus-within .lead-ico { color: var(--p-accent); opacity: 1; }
.input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.65rem;
    border: 1px solid var(--p-border);
    border-radius: 12px;
    font-size: 0.92rem;
    font-family: inherit;
    color: var(--p-text);
    background: #fbfcfd;
    transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: #9aa6b2; }
.input:focus {
    outline: none;
    background: #fff;
    border-color: var(--p-accent);
    box-shadow: 0 0 0 4px rgba(212,166,64,0.14);
}
.toggle-pass {
    position: absolute;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--p-muted);
    opacity: 0.7;
    padding: 0;
    border-radius: 9px;
    transition: color .18s, opacity .18s, background .18s;
}
.toggle-pass:hover { opacity: 1; color: var(--p-primary-2); background: rgba(20,80,92,0.07); }
.toggle-pass svg { width: 18px; height: 18px; }
.toggle-pass .ico-eye-off { display: none; }
.toggle-pass.is-visible .ico-eye { display: none; }
.toggle-pass.is-visible .ico-eye-off { display: block; color: var(--p-accent-hover); }

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.25rem 0 1.4rem;
    font-size: 0.78rem;
}
.field-row label { display: flex; align-items: center; gap: 0.45rem; color: var(--p-muted); cursor: pointer; }
.field-row a { color: var(--p-primary-2); font-weight: 500; }
.field-row a:hover { color: var(--p-accent-hover); }

.btn-auth {
    width: 100%;
    padding: 0.95rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
    color: #0c2e3c;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, opacity .2s;
    box-shadow: 0 8px 22px rgba(212,166,64,0.30);
}
.btn-auth:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(212,166,64,0.38); }
.btn-auth:active:not(:disabled) { transform: translateY(0); }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.auth-foot {
    margin-top: 1.75rem;
    font-size: 0.74rem;
    color: var(--p-muted);
    text-align: center;
}

/* ---- Notas / alertas ---- */
.note {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.75rem 0.9rem;
    border-radius: 11px;
    font-size: 0.8rem;
    margin-bottom: 1.1rem;
    line-height: 1.5;
}
.note-error   { background: rgba(239,68,68,0.08);  color: #b91c1c; border: 1px solid rgba(239,68,68,0.18); }
.note-warning { background: rgba(245,158,11,0.10); color: #b45309; border: 1px solid rgba(245,158,11,0.22); }
.note-success { background: rgba(16,185,129,0.08); color: #047857; border: 1px solid rgba(16,185,129,0.18); }
.note-info    { background: rgba(20,80,92,0.07);   color: #14505c; border: 1px solid rgba(20,80,92,0.16); }

/* ============ SHELL DEL PORTAL ============ */

.portal-topbar {
    background: linear-gradient(135deg, #0c2e3c, #14505c);
    color: #f8fafc;
    padding: 0.9rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 60;
}

.portal-topbar .brand { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.4px; }
.portal-topbar .brand .gold {
    background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.portal-topbar .brand small {
    font-weight: 400;
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(248,250,252,0.45);
    margin-left: 0.5rem;
}

.portal-user { display: flex; align-items: center; gap: 0.75rem; }
.portal-user .who { text-align: right; line-height: 1.3; }
.portal-user .who strong { display: block; font-size: 0.85rem; font-weight: 600; }
.portal-user .who span { font-size: 0.72rem; color: rgba(248,250,252,0.55); }
.portal-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--p-accent), var(--p-accent-2));
    color: #0c2e3c;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
}
.portal-logout {
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(248,250,252,0.2);
    border-radius: 8px;
    font-size: 0.78rem;
    color: rgba(248,250,252,0.8);
    transition: all 0.2s;
}
.portal-logout:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #fff; }

.portal-content { max-width: 1100px; margin: 0 auto; padding: 2.25rem 2rem 4rem; }

.portal-hello { margin-bottom: 2rem; }
.portal-hello h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.6px; }
.portal-hello p { color: var(--p-muted); font-size: 0.9rem; }

.p-card {
    background: var(--p-card);
    border: 1px solid var(--p-border);
    border-radius: 14px;
    padding: 1.5rem;
}

.p-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }

.p-soon { display: flex; gap: 1rem; align-items: flex-start; }
.p-soon .ico {
    flex: 0 0 44px; height: 44px;
    border-radius: 11px;
    background: rgba(20,80,92,0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.p-soon h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.p-soon p { font-size: 0.82rem; color: var(--p-muted); line-height: 1.55; }

.tag-soon {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(245,158,11,0.12);
    color: #b45309;
}

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

@media (max-width: 860px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main {
        background: var(--p-bg);
        align-items: flex-start;
        padding-top: 3rem;
    }
    .auth-card {
        background: var(--p-card);
        border: 1px solid var(--p-border);
        border-radius: 18px;
        padding: 2.25rem 1.6rem;
        box-shadow: 0 10px 40px rgba(12,46,60,0.07);
        max-width: 420px;
        text-align: center;
    }
    .auth-logo-img { margin-left: auto; margin-right: auto; }
    .auth-card form, .field-row { text-align: left; }
}

@media (max-width: 768px) {
    .portal-topbar { padding: 0.85rem 1rem; }
    .portal-topbar .brand small { display: none; }
    .portal-user .who { display: none; }
    .portal-content { padding: 1.5rem 1rem 3rem; }
}

@media (max-width: 480px) {
    .auth-card { padding: 2rem 1.3rem; }
}
