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

/* ===== BODY ===== */
body {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    color: #333;
}

/* ===== HEADER ===== */
.header {
    max-width: 1300px;
    margin: 35px auto 20px auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo {
    height: 60px;
}

.header-left h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.header-right {
    font-size: 13px;
    text-align: right;
    line-height: 1.6;
    color: #444;
}

/* ===== TABS ===== */
#tabs {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 25px 0 35px 0;
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.4;
}

.tab.active {
    opacity: 1;
}

.tab::before {
    content: attr(data-step);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.tab.active::before {
    background: black;
    color: white;
}

/* ===== FORM CARD ===== */
.form-column {
    display: flex;
    justify-content: center;
}

.tab-content {
    position: relative;
    max-width: 850px;
    width: 90%;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    margin: 30px auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* ===== WATERMARK ===== */
.tab-content > * {
    position: relative;
    z-index: 1;
}

.tab-content::before {
    content: "";
    position: absolute;
    inset: 0;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%);
    background-image: url("icono.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 55%;
    opacity: 0.15;
    pointer-events: none;
}

/* ===== TITLES ===== */
h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
}

/* ===== INPUTS ===== */
label {
    font-weight: 600;
    font-size: 14px;
    margin-top: 16px;
    display: block;
}

input,
select {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    font-size: 14px;
}

input:focus,
select:focus {
    border-color: black;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

input.error {
    border: 1px solid red;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

table th {
    background: #f4f6f9;
    padding: 10px;
    font-weight: 600;
    text-align: center;
}

table td {
    padding: 8px;
}

/* ===== BUTTONS ===== */
button {
    background: black;
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: 0.2s ease;
}

button:hover {
    opacity: 0.85;
}

button + button {
    margin-left: 15px;
}

/* ===== TOAST ===== */
#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    display: none;
    z-index: 9999;
    font-size: 14px;
}

/* ===== LOADER ===== */
#loaderOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 0 15px;
    }

    .header-left {
        flex-direction: column;
        gap: 10px;
    }

    .header-left h2 {
        font-size: 22px;
    }

    .logo {
        height: 45px;
    }

    #tabs {
        gap: 20px;
        flex-wrap: wrap;
    }

    .tab-content {
        max-width: 100%;
        padding: 25px;
        margin: 10px 15px 30px 15px;
        border-radius: 14px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    button {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* ===== Estilos que antes estaban dentro de index.php ===== */
/* 🔥 SOLO SE CORRIGIÓ ESTO */
.tab-content > * {
    position: relative;
    z-index: 1;
}

/* TODO TU CSS AQUÍ (EL RESET, HEADER, ETC) */

* {
    box-sizing: border-box;
}

:root {
    --primary: #0b2e59;
    --primary-hover: #082036;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #eef2f7;
    margin: 0;
    padding: 0;
}

.header {
    width: 90%;
    max-width: 850px;
    margin: 35px auto 20px auto; /* más compacto */
    padding: 0 0 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary);
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px; /* 🔥 antes era muy separado */
}

.logo {
    height: 60px;
    display: block;
}

.header-left h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.8px;
    color: var(--primary);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.header-right {
    font-size: 13px;
    text-align: right;
    line-height: 1.6;
    color: #444;
    min-width: 220px;
}

/* ===== TABS ===== */

#tabs {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 25px 0 35px 0;
}

.tab {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.4;
}

.tab.active {
    opacity: 1;
}

.tab::before {
    content: attr(data-step);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.tab.active::before {
    background: var(--primary);
    color: white;
}
/* ===== FORM CARD ===== */
.form-column {
    display: flex;
    justify-content: center;
}

.tab-content {
    position: relative;      /* 🔥 IMPORTANTE */
    max-width: 850px;
    width: 90%;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    margin: 30px auto;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    overflow: hidden;        /* 🔥 CLAVE para que no se salga */
}


/* ===================== */
/* MARCA DE AGUA UNISPAN */
/* ===================== */

.tab-content > * {
    position: relative;
    z-index: 1;
}

.tab-content::before {
    content: "";
    position: absolute;
    inset: 0;
    top: 50%;
    left: 50%;
    width: 500px;      /* 🔥 tamaño controlado */
    height: 500px;
    transform: translate(-50%, -50%);
    background-image: url("icono.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 55%;
    opacity: 0.15;    /* más sutil */
    pointer-events: none;
    z-index: 0;
    
}


/* ===== TITLES ===== */
h3 {
    font-family: 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #1d2233;
}

/* Los títulos que llevan <strong> por dentro deben verse igual que los demás */
h3 strong {
    font-weight: 600;
    color: inherit;
}

.titulo-seccion {
    margin-top: 35px;
}

/* ===== INPUTS ===== */
label {
    font-weight: 600;
    font-size: 14px;
    margin-top: 16px;
    color: #45516b;
}

input,
select {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    font-size: 14px;
}

input:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(11,46,89,0.12);
}

/* ===== TABLE ===== */
table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

table th {
    background: #f4f6f9;
    padding: 10px;
    font-weight: 600;
    text-align: center;
}

table td {
    padding: 8px;
}

/* ===== BUTTONS ===== */
button {
    background: var(--primary);
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 25px;
    transition: background 0.2s ease;
}

button:hover {
    background: var(--primary-hover);
}

button + button {
    margin-left: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

    .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    #tabs {
        gap: 20px;
        flex-wrap: wrap;
    }

    .tab-content {
        padding: 25px;
        border-radius: 14px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    button {
        width: 100%;
        margin-left: 0 !important;
    }
}

#tabs {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ============================= */
/* RESPONSIVE REGISTRO OBRA */
/* ============================= */

@media (max-width: 768px) {

    /* HEADER */
    .header {
        width: auto;
        max-width: none;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        margin: 20px 15px 10px 15px;
        padding: 0 0 15px 0;
    }

    .header-left {
        flex-direction: column;
        gap: 10px;
    }

    .header-left h2 {
        position: static;
        transform: none;
        white-space: normal;
        font-size: 22px;
        line-height: 1.2;
    }

    .header-right {
        text-align: center;
        font-size: 12px;
        min-width: 0;
    }

    .logo {
        height: 45px;
    }

    /* TABS */
    #tabs {
        gap: 20px;
        flex-wrap: wrap;
        margin: 15px 0 20px 0;
    }

    .tab {
        font-size: 14px;
    }

    /* CONTENEDOR FORM */
    .tab-content {
        max-width: 100%;
        padding: 25px;
        border-radius: 14px;
        margin: 10px 15px 30px 15px;
    }

    /* INPUTS */
    input,
    select {
        font-size: 14px;
        padding: 10px;
    }

    /* TABLA RESPONSIVE */
    table {
        display: block;
        overflow-x: auto;
    }

    /* BOTONES */
    button {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 15px;
    }
}



/* ===== Clases que reemplazan los estilos en línea (requisito de la CSP) ===== */
.error-msg {
    color: red;
    display: none;
}

.etiqueta-error {
    display: flex;
    align-items: center;
    gap: 8px;
}

input.error,
select.error {
    border: 1px solid red;
}

.loader-box {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.tab-content { display: none; }
#tab1 { display: block; }

/* Campo trampa anti-robots: fuera de la vista sin usar display:none */
.campo-trampa {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.cf-turnstile {
    margin-top: 20px;
}
