/*
 * Canaworks – Perfil Profesional
 * assets/css/perfil-profesional.css
 * Identidad visual: rojo corporativo, azul marino, blanco, grises
 */

/* ============================================================
   TOKENS
============================================================ */
:root {
    --cw-red:        #C8102E;
    --cw-red-dark:   #a80e26;
    --cw-red-light:  #fde8ec;
    --cw-navy:       #0A1F44;
    --cw-navy-mid:   #122a5c;
    --cw-white:      #ffffff;
    --cw-gray-light: #f4f6f9;
    --cw-gray-mid:   #e2e6ed;
    --cw-gray-text:  #6b7280;
    --cw-gray-dark:  #374151;
    --cw-black:      #111827;

    --cw-radius:     10px;
    --cw-radius-sm:  6px;
    --cw-shadow:     0 2px 12px rgba(10,31,68,.08);
    --cw-shadow-md:  0 6px 24px rgba(10,31,68,.13);

    --cw-font:       'Inter', system-ui, -apple-system, sans-serif;

    --cw-transition: .22s ease;
}

/* ============================================================
   BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--cw-font);
    color: var(--cw-black);
    background: var(--cw-white);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--cw-red); text-decoration: none; }
a:hover { color: var(--cw-red-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Focus visible */
*:focus-visible {
    outline: 3px solid var(--cw-red);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   HEADER / NAV
============================================================ */
.cw-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--cw-white);
    box-shadow: 0 1px 0 var(--cw-gray-mid), var(--cw-shadow);
}

.cw-navbar { padding: .75rem 0; }

.cw-logo { height: 40px; width: auto; }
.cw-logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cw-navy);
    letter-spacing: -.5px;
}

.navbar-nav .nav-link {
    font-size: .9rem;
    font-weight: 500;
    color: var(--cw-navy);
    padding: .45rem .75rem;
    border-radius: var(--cw-radius-sm);
    transition: color var(--cw-transition), background var(--cw-transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.cw-nav-active {
    color: var(--cw-red);
    background: var(--cw-red-light);
}

.cw-btn-nav {
    background: var(--cw-red) !important;
    color: var(--cw-white) !important;
    padding: .45rem 1.2rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
}
.cw-btn-nav:hover {
    background: var(--cw-red-dark) !important;
    color: var(--cw-white) !important;
}

/* Toggler personalizado */
.cw-toggler {
    border: none;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
}
.cw-toggler:focus { box-shadow: none; }
.toggler-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cw-navy);
    border-radius: 2px;
    transition: transform var(--cw-transition), opacity var(--cw-transition);
}
.cw-toggler[aria-expanded="true"] .toggler-icon:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.cw-toggler[aria-expanded="true"] .toggler-icon:nth-child(2) { opacity: 0; }
.cw-toggler[aria-expanded="true"] .toggler-icon:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   HERO INTERIOR
============================================================ */
.cw-hero-inner {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.cw-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.cw-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, rgba(10,31,68,.88) 0%, rgba(10,31,68,.65) 60%, rgba(10,31,68,.35) 100%);
    z-index: 1;
}

.cw-hero-content {
    position: relative;
    z-index: 2;
    padding: 80px 0 60px;
}

.cw-hero-label {
    display: inline-flex;
    align-items: center;
    background: rgba(200,16,46,.85);
    color: var(--cw-white);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .35rem .9rem;
    border-radius: 50px;
    margin-bottom: 1.2rem;
}

.cw-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--cw-white);
    line-height: 1.18;
    margin-bottom: 1rem;
    letter-spacing: -.5px;
}

.cw-hero-desc {
    color: rgba(255,255,255,.85);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    max-width: 520px;
}

.cw-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.cw-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.25);
    color: var(--cw-white);
    font-size: .82rem;
    font-weight: 500;
    padding: .3rem .8rem;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}

/* ============================================================
   INTRO
============================================================ */
.cw-intro {
    padding: 64px 0 48px;
    background: var(--cw-white);
}

.cw-section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--cw-navy);
    margin-bottom: 1rem;
    letter-spacing: -.4px;
}

.cw-intro-text {
    color: var(--cw-gray-dark);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: .75rem;
}

.cw-intro-sub {
    color: var(--cw-gray-text);
    font-size: .95rem;
    line-height: 1.65;
    margin-bottom: 0;
}

/* ============================================================
   FORM SECTION
============================================================ */
.cw-form-section {
    padding: 0 0 80px;
    background: var(--cw-gray-light);
}

/* ============================================================
   STEPPER
============================================================ */
.cw-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 36px;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
}
.cw-stepper::-webkit-scrollbar { display: none; }

.cw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.cw-step span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--cw-gray-mid);
    color: var(--cw-gray-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .875rem;
    font-weight: 700;
    transition: background var(--cw-transition), color var(--cw-transition);
}

.cw-step small {
    font-size: .7rem;
    color: var(--cw-gray-text);
    font-weight: 500;
    white-space: nowrap;
}

.cw-step.active span {
    background: var(--cw-red);
    color: var(--cw-white);
    box-shadow: 0 0 0 4px var(--cw-red-light);
}
.cw-step.active small { color: var(--cw-red); font-weight: 600; }

.cw-step.done span {
    background: var(--cw-navy);
    color: var(--cw-white);
}
.cw-step.done small { color: var(--cw-navy); }

.cw-step-line {
    flex: 1;
    height: 2px;
    background: var(--cw-gray-mid);
    min-width: 12px;
    max-width: 60px;
}

/* ============================================================
   TARJETAS DE SECCIÓN
============================================================ */
.cw-card {
    background: var(--cw-white);
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow var(--cw-transition);
}
.cw-card:hover { box-shadow: var(--cw-shadow-md); }

.cw-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.4rem 1.6rem;
    border-bottom: 1px solid var(--cw-gray-mid);
    background: var(--cw-gray-light);
}

.cw-section-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cw-red);
    color: var(--cw-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}

.cw-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cw-navy);
    margin-bottom: .2rem;
}

.cw-card-subtitle {
    font-size: .85rem;
    color: var(--cw-gray-text);
    margin-bottom: 0;
}

.cw-card-body {
    padding: 1.6rem;
}

/* ============================================================
   CAMPOS DE FORMULARIO
============================================================ */
.cw-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--cw-navy);
    margin-bottom: .4rem;
}

.cw-required {
    color: var(--cw-red);
    font-weight: 700;
    margin-left: 2px;
}

.cw-input {
    border: 1.5px solid var(--cw-gray-mid);
    border-radius: var(--cw-radius-sm);
    padding: .6rem .85rem;
    font-size: .93rem;
    color: var(--cw-black);
    background: var(--cw-white);
    transition: border-color var(--cw-transition), box-shadow var(--cw-transition);
    width: 100%;
}

.cw-input:focus {
    border-color: var(--cw-navy);
    box-shadow: 0 0 0 3px rgba(10,31,68,.1);
    outline: none;
}

.cw-input.is-invalid {
    border-color: var(--cw-red);
    box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}

.cw-input.is-valid {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,.08);
}

.cw-textarea { resize: vertical; min-height: 90px; }

/* Prefijo monetario */
.cw-prefix {
    background: var(--cw-gray-light);
    border: 1.5px solid var(--cw-gray-mid);
    border-right: none;
    color: var(--cw-gray-text);
    font-size: .85rem;
    font-weight: 600;
    border-radius: var(--cw-radius-sm) 0 0 var(--cw-radius-sm);
    padding: .6rem .75rem;
}

.input-group .cw-input {
    border-radius: 0 var(--cw-radius-sm) var(--cw-radius-sm) 0;
}

/* Radios personalizados */
.cw-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    padding-top: .2rem;
}

.cw-radio {
    display: flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
}

.cw-radio .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--cw-gray-mid);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color var(--cw-transition);
}

.cw-radio .form-check-input:checked {
    background-color: var(--cw-red);
    border-color: var(--cw-red);
}

.cw-radio .form-check-label {
    font-size: .92rem;
    color: var(--cw-gray-dark);
    cursor: pointer;
    font-weight: 500;
}

/* Contador de caracteres */
.cw-counter {
    font-size: .78rem;
    color: var(--cw-gray-text);
    text-align: right;
    margin-top: .3rem;
}

.cw-count-current { font-weight: 600; color: var(--cw-gray-dark); }
.cw-count-current.cw-count-warn { color: #b45309; }
.cw-count-current.cw-count-max { color: var(--cw-red); }

/* Caja de ayuda */
.cw-hint-box {
    background: #eef2ff;
    border-left: 3px solid #4f46e5;
    color: #3730a3;
    font-size: .82rem;
    padding: .5rem .75rem;
    border-radius: 0 var(--cw-radius-sm) var(--cw-radius-sm) 0;
    margin-bottom: .6rem;
}

.cw-hint { font-size: .78rem; color: var(--cw-gray-text); margin-top: .3rem; }

/* ============================================================
   AVISO DE PRIVACIDAD
============================================================ */
.cw-privacy-box {
    background: var(--cw-white);
    border-radius: var(--cw-radius);
    border: 1.5px solid var(--cw-gray-mid);
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--cw-shadow);
}

.cw-check .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--cw-gray-mid);
    margin-top: .22rem;
    cursor: pointer;
    flex-shrink: 0;
}
.cw-check .form-check-input:checked {
    background-color: var(--cw-red);
    border-color: var(--cw-red);
}

.cw-check .form-check-label {
    font-size: .9rem;
    color: var(--cw-gray-dark);
    cursor: pointer;
    line-height: 1.5;
}

.cw-link { color: var(--cw-red); font-weight: 600; }
.cw-link:hover { color: var(--cw-red-dark); }

.cw-privacy-note {
    font-size: .82rem;
    color: var(--cw-gray-text);
    margin-top: .9rem;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    gap: .3rem;
}

/* ============================================================
   BOTONES
============================================================ */
.cw-btn-primary {
    background: var(--cw-red);
    color: var(--cw-white);
    border: none;
    border-radius: 50px;
    padding: .75rem 2rem;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--cw-transition), transform .12s ease, box-shadow .12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.cw-btn-primary:hover {
    background: var(--cw-red-dark);
    color: var(--cw-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(200,16,46,.28);
    text-decoration: none;
}
.cw-btn-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cw-btn-outline {
    background: transparent;
    color: var(--cw-navy);
    border: 2px solid var(--cw-navy);
    border-radius: 50px;
    padding: .72rem 1.8rem;
    font-size: .95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background var(--cw-transition), color var(--cw-transition);
}
.cw-btn-outline:hover {
    background: var(--cw-navy);
    color: var(--cw-white);
    text-decoration: none;
}

.cw-btn-whatsapp {
    background: #25D366;
    color: var(--cw-white);
    border: none;
    border-radius: 50px;
    padding: .75rem 2rem;
    font-size: .95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background var(--cw-transition);
}
.cw-btn-whatsapp:hover {
    background: #1ebe5e;
    color: var(--cw-white);
    text-decoration: none;
}

.cw-btn-submit { width: 100%; }

.cw-submit-wrap {
    margin-top: .5rem;
}

/* ============================================================
   PANTALLAS DE RESULTADO
============================================================ */
.cw-result-screen { margin-top: 2rem; }

.cw-result-card {
    background: var(--cw-white);
    border-radius: var(--cw-radius);
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--cw-shadow-md);
}

.cw-result-icon {
    font-size: 3.5rem;
    margin-bottom: 1.2rem;
    display: block;
}
.cw-result-success .cw-result-icon { color: #16a34a; }
.cw-result-error .cw-result-icon { color: var(--cw-red); }

.cw-result-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--cw-navy);
    margin-bottom: .75rem;
    letter-spacing: -.4px;
}

.cw-result-text {
    color: var(--cw-gray-dark);
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.cw-folio-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: var(--cw-gray-light);
    border: 1.5px dashed var(--cw-gray-mid);
    border-radius: var(--cw-radius-sm);
    padding: .9rem 2rem;
    margin-bottom: 1.2rem;
}

.cw-folio-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cw-gray-text);
    font-weight: 600;
    margin-bottom: .3rem;
}

.cw-folio-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--cw-navy);
    letter-spacing: .05em;
    font-variant-numeric: tabular-nums;
}

.cw-result-note {
    font-size: .85rem;
    color: var(--cw-gray-text);
    margin-bottom: 1.75rem;
}

.cw-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    justify-content: center;
}

/* ============================================================
   HONEYPOT
============================================================ */
.cw-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
   FOOTER
============================================================ */
.cw-footer {
    background: var(--cw-navy);
    color: rgba(255,255,255,.75);
    padding: 56px 0 0;
}

.cw-footer-logo { height: 36px; width: auto; }
.cw-footer-logo-text {
    color: var(--cw-white);
    font-size: 1.4rem;
    font-weight: 800;
}
.cw-footer-logo-link:hover { text-decoration: none; }

.cw-footer-desc {
    font-size: .88rem;
    color: rgba(255,255,255,.6);
    margin-top: .75rem;
    line-height: 1.6;
}

.cw-footer-heading {
    font-size: .85rem;
    font-weight: 700;
    color: var(--cw-white);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
}

.cw-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.cw-footer-list a {
    color: rgba(255,255,255,.65);
    font-size: .88rem;
    text-decoration: none;
    transition: color var(--cw-transition);
}
.cw-footer-list a:hover { color: var(--cw-white); }

.cw-footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.cw-footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    font-size: .88rem;
    color: rgba(255,255,255,.65);
    line-height: 1.5;
}

.cw-footer-contact i {
    color: var(--cw-red);
    font-size: .95rem;
    margin-top: .15rem;
    flex-shrink: 0;
}

.cw-footer-contact a {
    color: rgba(255,255,255,.65);
    transition: color var(--cw-transition);
}
.cw-footer-contact a:hover { color: var(--cw-white); }

.cw-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 40px;
    padding: 1.2rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.cw-footer-bottom p {
    margin: 0;
    font-size: .82rem;
    color: rgba(255,255,255,.45);
}

.cw-footer-privacy {
    font-size: .82rem;
    color: rgba(255,255,255,.5);
    transition: color var(--cw-transition);
}
.cw-footer-privacy:hover { color: var(--cw-white); }

/* ============================================================
   WHATSAPP FLOTANTE
============================================================ */
.cw-whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cw-white);
    font-size: 1.5rem;
    z-index: 990;
    box-shadow: 0 4px 16px rgba(37,211,102,.4);
    transition: transform .2s ease, box-shadow .2s ease;
    text-decoration: none;
}
.cw-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 22px rgba(37,211,102,.55);
    color: var(--cw-white);
    text-decoration: none;
}

/* ============================================================
   INVALID FEEDBACK TWEAK
============================================================ */
.invalid-feedback { font-size: .8rem; }
.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback { display: block; }

/* ============================================================
   ANIMACIÓN FADE-IN PARA TARJETAS
============================================================ */
.cw-card { opacity: 0; transform: translateY(16px); }
.cw-card.cw-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .4s ease, transform .4s ease;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    .cw-hero-inner { min-height: 320px; }
    .cw-hero-content { padding: 56px 0 40px; }

    .cw-card-body { padding: 1.2rem; }
    .cw-card-header { padding: 1.1rem 1.2rem; }

    .cw-result-card { padding: 2rem 1.25rem; }

    .cw-stepper { padding: 20px 0 28px; }
    .cw-step small { display: none; }
    .cw-step span { width: 30px; height: 30px; font-size: .8rem; }

    .cw-btn-primary,
    .cw-btn-outline,
    .cw-btn-whatsapp { width: 100%; }

    .cw-result-actions { flex-direction: column; }

    .cw-footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 576px) {
    .cw-section-title { font-size: 1.4rem; }
    .cw-hero-title { font-size: 1.6rem; }
    .cw-folio-num { font-size: 1.1rem; }
}
