:root {
    color-scheme: light;
    --bg: #f6f8fb;
    --panel: #ffffff;
    --panel-soft: #f9fbfd;
    --text: #172033;
    --muted: #607086;
    --line: #dbe4ee;
    --brand: #0a66c2;
    --brand-dark: #074f97;
    --success: #148a46;
    --warning: #9a6a00;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(23, 32, 51, 0.12);
}

* { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(10, 102, 194, 0.10), transparent 32rem),
        linear-gradient(180deg, #ffffff 0%, var(--bg) 45%, #eef3f8 100%);
}

button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

.watermark, .logo-agua {
    opacity: 0.08;
    filter: saturate(0.8);
}

.content {
    min-height: 100vh;
    height: auto !important;
    padding: 24px;
}

.outer-box, .contenedor-principal, .lista, .archivos {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: var(--shadow) !important;
}

.outer-box {
    max-width: 460px !important;
    padding: 28px !important;
}

.logo { width: min(280px, 78vw) !important; }

h1, h2, h3 {
    color: var(--text) !important;
    letter-spacing: 0;
}

h2 {
    font-size: 24px !important;
    line-height: 1.2;
}

label {
    color: var(--text) !important;
    font-size: 14px;
}

input[type="text"], input[type="password"], input[type="email"], input[type="tel"], select {
    width: 100% !important;
    min-height: 48px;
    padding: 12px 14px !important;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: var(--panel-soft) !important;
    color: var(--text);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.14);
}

input[type="submit"], .btn-subir, .button-primary {
    min-height: 48px;
    border: 0;
    border-radius: 8px !important;
    background: var(--brand) !important;
    color: #fff !important;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
    box-shadow: 0 10px 20px rgba(10, 102, 194, 0.18);
}

input[type="submit"]:hover, .btn-subir:hover, .button-primary:hover {
    background: var(--brand-dark) !important;
    transform: translateY(-1px);
}

input[type="submit"]:disabled, .btn-subir:disabled {
    background: #b8c4d0 !important;
    box-shadow: none;
    transform: none;
}

.error, .mensaje-error {
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff1f0;
    color: var(--danger) !important;
    border: 1px solid #ffd7d3;
}

.footer-text { color: var(--muted) !important; }

.contenedor-principal {
    max-width: 980px !important;
    padding: 28px !important;
}

.documentos-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px !important;
}

.doc-card {
    max-width: none !important;
    width: 100%;
    min-height: 210px;
    border: 1px solid var(--line);
    border-radius: 8px !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.doc-titulo {
    color: var(--text) !important;
    line-height: 1.25;
}

.estado {
    width: 100%;
    border-radius: 999px !important;
    line-height: 1.25;
}

.estado.correcto {
    background: #eaf7ef !important;
    color: var(--success) !important;
}

.estado.pendiente {
    background: #fff7e6 !important;
    color: var(--warning) !important;
}

.estado.rechazado {
    background: #fff1f0 !important;
    color: var(--danger) !important;
}

.mensaje-exito {
    background: #eaf7ef !important;
    color: var(--success) !important;
    border: 1px solid #bfe7cd;
}

.contenedor { align-items: flex-start; }
.lista, .archivos { width: 100% !important; }
.archivo a, .lista a { overflow-wrap: anywhere; }

@media (max-width: 900px) {
    .documentos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body { overflow: auto !important; }
    .content {
        align-items: flex-start !important;
        padding: 16px;
    }
    .outer-box, .contenedor-principal {
        padding: 20px !important;
    }
    h2 { font-size: 21px !important; }
    .documentos-grid, .contenedor {
        grid-template-columns: 1fr;
        display: grid !important;
    }
    .doc-card { min-height: 185px; }
    .btn-subir {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Visual refresh v2 */
body {
    background:
        linear-gradient(120deg, rgba(7, 79, 151, 0.12), rgba(20, 138, 70, 0.06) 42%, rgba(246, 248, 251, 0.92)),
        #eef3f8;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(10, 102, 194, 0.08) 1px, transparent 1px),
        linear-gradient(180deg, rgba(10, 102, 194, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 75%);
}

.watermark {
    opacity: 0.035 !important;
    width: min(1200px, 112vw) !important;
}

.outer-box {
    position: relative;
    overflow: hidden;
    max-width: 500px !important;
    padding: 34px !important;
    border: 1px solid rgba(10, 102, 194, 0.16) !important;
}

.outer-box::before,
.contenedor-principal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--brand), #21a67a, #f2b84b);
}

.outer-box .logo {
    margin-bottom: 26px !important;
}

.outer-box h2 {
    margin-top: 0;
    margin-bottom: 26px !important;
    font-size: 28px !important;
}

.outer-box form {
    text-align: left;
}

.outer-box input[type="submit"] {
    margin-top: 6px;
}

.footer-text {
    padding-top: 10px;
    line-height: 1.35;
}

.contenedor-principal {
    position: relative;
    overflow: hidden;
    text-align: left !important;
}

.contenedor-principal h2 {
    margin-top: 8px;
    margin-bottom: 24px !important;
    padding-right: 160px;
}

.logo-agua {
    opacity: 0.72 !important;
    width: 132px !important;
}

.doc-card {
    position: relative;
    padding: 22px !important;
    background:
        linear-gradient(180deg, #ffffff, #f7fafc) !important;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.doc-card::before {
    content: "";
    display: block;
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(10, 102, 194, 0.16), rgba(33, 166, 122, 0.16)),
        #eef6ff;
    border: 1px solid rgba(10, 102, 194, 0.18);
}

.doc-card:hover {
    border-color: rgba(10, 102, 194, 0.35);
    box-shadow: 0 16px 30px rgba(23, 32, 51, 0.10) !important;
}

.btn-subir {
    letter-spacing: 0;
}

.mensaje-exito {
    width: 100%;
    display: block !important;
    padding: 16px !important;
    text-align: left;
}

.buscar-form,
.contenedor-formulario {
    position: relative;
    z-index: 1;
}

.caja {
    background: rgba(255, 255, 255, 0.96) !important;
}

.caja h3 {
    color: var(--brand) !important;
}

button {
    background: var(--brand) !important;
}

button:hover {
    background: var(--brand-dark) !important;
}

@media (max-width: 640px) {
    .watermark {
        display: none;
    }

    .outer-box {
        max-width: none !important;
        min-height: calc(100vh - 32px);
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .outer-box h2 {
        font-size: 25px !important;
    }

    .contenedor-principal h2 {
        padding-right: 0;
    }

    .logo-agua {
        position: static !important;
        display: block;
        margin: 0 auto 12px;
        opacity: 1 !important;
        width: 118px !important;
    }

    .doc-card {
        min-height: 176px;
    }
}

/* Login app shell */
.content {
    display: grid !important;
    grid-template-columns: minmax(300px, 460px) minmax(380px, 500px);
    gap: 32px;
    align-items: center !important;
    justify-content: center !important;
    max-width: 1100px;
    margin: 0 auto;
}

.content::before {
    content: "BrokerCheck\A Portal documental";
    white-space: pre-line;
    min-height: 640px;
    border-radius: 10px;
    padding: 36px;
    display: flex;
    align-items: flex-end;
    color: #ffffff;
    font-size: 38px;
    font-weight: 800;
    line-height: 1.05;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
    background:
        linear-gradient(180deg, rgba(7, 79, 151, 0.12), rgba(7, 79, 151, 0.82)),
        url("../../imagenes/broker.png") center 34% / min(78%, 340px) no-repeat,
        linear-gradient(135deg, #0a66c2, #21a67a 58%, #f2b84b);
    box-shadow: var(--shadow);
}

.outer-box {
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.outer-box::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    right: -70px;
    bottom: -70px;
    border-radius: 50%;
    background: rgba(33, 166, 122, 0.12);
}

.outer-box form,
.outer-box .footer-text,
.outer-box h2,
.outer-box .logo {
    position: relative;
    z-index: 1;
}

@media (max-width: 860px) {
    .content {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .content::before {
        display: none;
    }

    .outer-box {
        min-height: calc(100vh - 32px);
    }
}

/* Consulta usuarios */
.consulta-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
    position: relative;
}

.consulta-panel {
    border: 1px solid rgba(10, 102, 194, 0.16);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.consulta-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 26px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(7, 79, 151, 0.96), rgba(10, 102, 194, 0.86) 48%, rgba(33, 166, 122, 0.88)),
        url("../../imagenes/broker.png") right 24px center / 220px auto no-repeat;
}

.consulta-hero-alerta {
    background:
        linear-gradient(135deg, rgba(139, 28, 28, 0.98), rgba(185, 28, 28, 0.94) 48%, rgba(239, 68, 68, 0.88)),
        url("../../imagenes/broker.png") right 24px center / 220px auto no-repeat;
}

.consulta-hero-alerta .consulta-status {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.34);
}

.consulta-hero-alerta .consulta-pill {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.30);
}

.consulta-kicker {
    margin: 0 0 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.82;
}

.consulta-title {
    margin: 0;
    color: #fff !important;
    font-size: 30px !important;
    line-height: 1.12;
}

.consulta-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.consulta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
}

.consulta-status {
    min-width: 230px;
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.24);
    text-align: left;
}

.consulta-status span {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 6px;
}

.consulta-status strong {
    display: block;
    color: #fff;
    line-height: 1.25;
}

.consulta-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
    gap: 24px;
    padding: 24px;
}

.consulta-info,
.consulta-upload {
    min-width: 0;
}

.mensaje-retorno {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none;
}

.mensaje-retorno h2 {
    font-size: 24px !important;
}

.mensaje-retorno h3 {
    margin-top: 24px;
    color: var(--brand) !important;
}

.mensaje-retorno p,
.mensaje-retorno li {
    color: #344256;
    line-height: 1.6;
}

.consulta-upload {
    position: sticky;
    top: 18px;
    align-self: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.consulta-upload h3 {
    margin-top: 0;
    color: var(--text) !important;
}

.fila-carga {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px !important;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.boton-foto {
    width: 100% !important;
    min-height: 44px;
    border-radius: 8px !important;
    background: var(--brand) !important;
}

.estado-carga {
    width: 100%;
    border-radius: 999px !important;
    font-weight: 700;
}

.nombre-archivo {
    margin: 4px 0 12px !important;
    color: var(--muted) !important;
    overflow-wrap: anywhere;
}

.estado-cliente {
    display: none;
}

.estado-normal,
.estado-fraude {
    border-radius: 8px !important;
}

@media (max-width: 920px) {
    .consulta-hero {
        grid-template-columns: 1fr;
        background:
            linear-gradient(135deg, rgba(7, 79, 151, 0.96), rgba(10, 102, 194, 0.86) 48%, rgba(33, 166, 122, 0.88));
    }

    .consulta-status {
        min-width: 0;
    }

    .consulta-layout {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .consulta-upload {
        position: static;
    }
}

@media (max-width: 560px) {
    .consulta-shell {
        width: calc(100% - 20px);
        margin: 10px auto;
    }

    .consulta-hero {
        padding: 20px;
    }

    .consulta-title {
        font-size: 24px !important;
    }
}

/* Email verification */
body > .outer-box {
    position: relative;
}

body > .outer-box h2 {
    color: var(--text) !important;
}

body > .outer-box strong {
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}

/* Document upload flow */
.documentos-shell {
    max-width: 1040px !important;
    padding: 0 !important;
    overflow: hidden;
}

.documentos-hero {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 320px);
    gap: 20px;
    align-items: center;
    padding: 26px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(7, 79, 151, 0.97), rgba(10, 102, 194, 0.86) 50%, rgba(33, 166, 122, 0.9)),
        url("../../imagenes/broker.png") right 26px center / 190px auto no-repeat;
}

.documentos-hero h2 {
    margin: 0 !important;
    color: #fff !important;
    font-size: 30px !important;
}

.documentos-progress-card {
    padding: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    text-align: left;
}

#documentos-progress-label {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-weight: 700;
}

.documentos-progress {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.26);
}

#documentos-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f2b84b, #ffffff);
    transition: width 0.25s ease;
}

.documentos-shell .documentos-grid {
    padding: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch !important;
}

.documentos-shell .doc-card {
    min-height: 235px;
    padding: 18px !important;
    text-align: left !important;
}

.documentos-shell .doc-card::before {
    margin: 0 0 16px;
}

.documentos-shell .doc-titulo {
    min-height: 42px;
    margin-bottom: 12px;
    font-size: 15px;
}

.documentos-shell .estado {
    text-align: center;
    margin: 0 0 14px;
}

.documentos-shell .estado.proceso {
    background: #fff7e6 !important;
    color: #9a6a00 !important;
}

.documentos-shell .btn-subir {
    width: 100% !important;
    max-width: none !important;
}

.documentos-shell .doc-correcto {
    border-color: #bfe7cd;
    background: linear-gradient(180deg, #ffffff, #f0fbf4) !important;
}

.documentos-shell .doc-correcto::before {
    background:
        linear-gradient(135deg, rgba(20, 138, 70, 0.18), rgba(33, 166, 122, 0.18)),
        #eaf7ef;
    border-color: #bfe7cd;
}

.documentos-shell .doc-rechazado {
    border-color: #ffc7c2;
    background: linear-gradient(180deg, #ffffff, #fff5f4) !important;
}

.documentos-shell .doc-rechazado::before {
    background:
        linear-gradient(135deg, rgba(180, 35, 24, 0.14), rgba(239, 68, 68, 0.14)),
        #fff1f0;
    border-color: #ffc7c2;
}

.documentos-shell #mensaje-todos-correctos {
    padding: 0 24px 24px;
}

.documentos-shell .mensaje-exito {
    max-width: 620px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .documentos-shell .documentos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .documentos-shell {
        width: calc(100vw - 20px) !important;
    }

    .documentos-hero {
        grid-template-columns: 1fr;
        padding: 20px;
        background:
            linear-gradient(135deg, rgba(7, 79, 151, 0.97), rgba(10, 102, 194, 0.86) 50%, rgba(33, 166, 122, 0.9));
    }

    .documentos-hero h2 {
        font-size: 25px !important;
    }

    .documentos-shell .documentos-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .documentos-shell .doc-card {
        min-height: 0;
    }
}
