/* ==========================================
   SENA - Registro Hoja de Vida (formulario público)
   ========================================== */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f5;
    color: #222;
}

.form-page {
    min-height: 100vh;
    padding: 30px 16px;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;

    /* Fondo decorativo: degradados verdes + patrón de puntos, en el estilo SENA */
    background-color: #f4f6f5;
    background-image:
        radial-gradient(circle, #1b5e20 1.6px, transparent 1.6px),
        radial-gradient(circle, #1b5e20 1.6px, transparent 1.6px),
        linear-gradient(135deg, rgba(46,125,50,0.10) 0%, rgba(46,125,50,0) 45%),
        linear-gradient(-35deg, rgba(76,175,80,0.12) 0%, rgba(76,175,80,0) 50%);
    background-size:
        26px 26px,
        26px 26px,
        100% 100%,
        100% 100%;
    background-position:
        0 0,
        13px 13px,
        0 0,
        0 0;
    background-repeat: repeat, repeat, no-repeat, no-repeat;
}

/* Manchas/burbujas decorativas en las esquinas */
.form-page::before,
.form-page::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.form-page::before {
    width: 420px;
    height: 420px;
    top: -160px;
    left: -160px;
    background: radial-gradient(circle, rgba(46,125,50,0.18) 0%, rgba(46,125,50,0) 70%);
}

.form-page::after {
    width: 520px;
    height: 520px;
    bottom: -220px;
    right: -200px;
    background: radial-gradient(circle, rgba(76,175,80,0.18) 0%, rgba(76,175,80,0) 70%);
}

.form-wrapper {
    width: 100%;
    max-width: 1000px;
    position: relative;
    z-index: 1;
}

/* Encabezado */
.form-header {
    background: #fff;
    border-radius: 10px;
    padding: 22px 28px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.form-header h1 {
    margin: 0 0 4px;
    font-size: 1.6rem;
    color: #1b1b1b;
}
.form-header p {
    margin: 0;
    color: #6b6b6b;
    font-size: 0.9rem;
}

/* Barra de pasos */
.steps-bar {
    background: #fff;
    border-radius: 10px;
    padding: 22px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow-x: auto;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    text-align: center;
    flex: 1;
}
.step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    color: #9a9a9a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.2s;
}
.step-label {
    font-size: 0.78rem;
    margin-top: 6px;
    color: #888;
    font-weight: 600;
    line-height: 1.2;
}
.step.active .step-circle {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}
.step.active .step-label { color: #2e7d32; }
.step.done .step-circle {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}
.step.done .step-label { color: #2e7d32; }
.step-connector {
    flex: 0.5;
    height: 2px;
    background: #e0e0e0;
    margin-top: 18px;
}

/* Alertas */
.alert-error {
    background: #fdecea;
    border: 1px solid #f5c6cb;
    color: #c62828;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* Secciones del formulario */
.form-section {
    display: none;
    background: #fff;
    border-radius: 10px;
    padding: 28px 28px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 16px;
    animation: fadeIn 0.25s ease;
}
.form-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.section-icon {
    font-size: 1.6rem;
    background: #e8f5e9;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.section-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #1b1b1b;
}
.section-head p {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: #888;
}
.required-note {
    margin-left: auto;
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
}
.req { color: #d32f2f; }

.block-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #444;
    margin: 22px 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Grid de filas */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
.form-row.row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 7px;
    font-size: 0.9rem;
    color: #333;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.form-control:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
    background: #fff;
}
textarea.form-control { resize: vertical; min-height: 90px; }

.hint {
    display: block;
    font-size: 0.78rem;
    color: #999;
    margin-top: 5px;
}

/* Navegación entre pasos */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 4px 4px;
}
.spacer { flex: 1; }

.btn-prev, .btn-next, .btn-submit {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-prev {
    background: #fff;
    border: 1.5px solid #d0d0d0;
    color: #555;
}
.btn-prev:hover { background: #f4f4f4; }
.btn-next, .btn-submit {
    background: #2e7d32;
    color: #fff;
}
.btn-next:hover, .btn-submit:hover { background: #1b5e20; }

/* Responsive */
@media (max-width: 720px) {
    .form-row, .form-row.row-3 {
        grid-template-columns: 1fr;
    }
    .required-note { display: none; }
    .step-label { font-size: 0.68rem; }
}

/* ---- BOTÓN VOLVER AL INICIO ---- */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background .2s, transform .2s;
}

.btn-back:hover {
    background: #1b5e20;
    transform: translateX(-3px);
}

.btn-back svg {
    width: 18px;
    height: 18px;
}

/* ---- AUTORIZACIÓN DE TRATAMIENTO DE DATOS ---- */
.consent-box {
    margin-top: 18px;
    padding: 14px 16px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #2e2e2e;
}

.consent-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #2e7d32;
    cursor: pointer;
}

/* ---- LAYOUT CON PANEL LATERAL ---- */
.form-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* El formulario centrado dentro del área */
.form-layout .form-wrapper {
    margin: 0 auto;
}

.form-layout .form-wrapper {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---- PANEL LATERAL DECORATIVO ---- */
.form-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.sidebar-logo-icon {
    width: 56px;
    height: 56px;
}

.sidebar-logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: #2e7d32;
}

.sidebar-tagline {
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    margin: 0;
    text-align: left;
}

.sidebar-tagline strong {
    color: #2e7d32;
}

/* Ilustración de edificio hecha con CSS (sin depender de imágenes externas) */
.sidebar-image {
    margin-top: 4px;
    border-radius: 12px;
    overflow: hidden;
    height: 260px;
    position: relative;
    background:
        linear-gradient(to top, #4a7c4e 0%, #4a7c4e 18%, transparent 18%),
        repeating-linear-gradient(
            to right,
            #cfd8d6 0px, #cfd8d6 26px,
            #e8eef0 26px, #e8eef0 52px
        ),
        linear-gradient(to bottom, #eef3f1 0%, #dfe7e5 100%);
    background-size: 100% 100%, 100% 75%, 100% 100%;
    background-position: bottom, top, top;
    background-repeat: no-repeat;
}

/* Ventanas del edificio */
.sidebar-image::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    height: 60%;
    background-image: repeating-linear-gradient(
            to bottom,
            transparent 0px, transparent 16px,
            rgba(255,255,255,0.55) 16px, rgba(255,255,255,0.55) 18px
        ),
        repeating-linear-gradient(
            to right,
            transparent 0px, transparent 16px,
            rgba(255,255,255,0.55) 16px, rgba(255,255,255,0.55) 18px
        );
}

/* Símbolo SENA sobre el edificio */
.sidebar-image::after {
    content: "";
    position: absolute;
    top: 30px;
    right: 28px;
    width: 34px;
    height: 34px;
    background-color: #2e7d32;
    opacity: 0.85;
    clip-path: polygon(50% 0%, 65% 35%, 100% 35%, 72% 58%, 82% 100%, 50% 75%, 18% 100%, 28% 58%, 0% 35%, 35% 35%);
}

@media (max-width: 900px) {
    .form-layout {
        flex-direction: column;
    }
    .form-sidebar {
        flex: 1 1 auto;
        position: static;
        width: 100%;
    }
    .sidebar-image {
        height: 180px;
    }
}
