/* ============================================
   REGISTRO DE ALIADOS TRIPWIN
   CSS optimizado final
   - Tailwind resuelve layout, spacing y responsive del markup
   - CSS conserva diseño visual premium y estados reutilizables
   ============================================ */

/* --------------------------------------------
   1. BASE GLOBAL
-------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.app-card,
.wizard-layout,
.wizard-aside,
.wizard-main,
.wizard-main-inner,
.wizard-card,
.wizard-card-header,
.wizard-card-body,
.wizard-panel,
.wizard-panel .grid,
.wizard-panel .grid > div,
.field-group-enhanced,
.summary-card,
.type-card,
.check-wrap,
.panel-intro,
.selected-type-inline,
.selected-type-inline__value,
#registroWizardRoot {
    min-width: 0;
}

.wizard-panel .grid > div,
.field-group-enhanced,
.selected-type-inline__value,
.wizard-step span,
.wizard-step > div {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#stepper,
.stepper-scroll {
    max-width: 100%;
}

/* --------------------------------------------
   2. HEADER COMPARTIDO
-------------------------------------------- */
.shared-auth-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f1216 0%, #2c3e50 100%);
    color: #fff;
    padding: 16px 16px 14px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.shared-auth-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/img/bg/registro/auth-bg.png") no-repeat center center;
    background-size: cover;
    opacity: 0.14;
}

.shared-auth-header::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 48%;
    background: linear-gradient(to top, rgba(11, 18, 32, 0.22), rgba(11, 18, 32, 0));
    pointer-events: none;
}

.shared-auth-header__inner {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.shared-auth-header__module {
    margin-bottom: 6px;
    color: #fb7305;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.shared-auth-header__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border: 2px solid rgba(251, 115, 5, 0.28);
    border-radius: 15px;
    background: rgba(251, 115, 5, 0.18);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
}

.shared-auth-header__logo i {
    font-size: 18px;
    color: #fb7305;
}

.shared-auth-header__title {
    margin-bottom: 6px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.shared-auth-header__subtitle {
    max-width: 62ch;
    margin: 0 auto;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    opacity: 0.88;
}

.shared-auth-header__microcopy {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    line-height: 1.45;
}

.shared-auth-header__microcopy a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
    transition: border-color 0.18s ease, color 0.18s ease;
}

.shared-auth-header__microcopy a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.52);
}

/* --------------------------------------------
   3. ESTRUCTURA VISUAL DEL WIZARD
-------------------------------------------- */
.wizard-layout {
    align-items: stretch;
    background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}

.wizard-aside {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(251, 115, 5, 0.12), transparent 28%),
        linear-gradient(180deg, #0f172a 0%, #111827 100%);
}

.wizard-aside-inner {
    padding: 28px 28px 30px;
    gap: 0;
}

.wizard-main-inner {
    max-width: 100%;
    padding: 24px 22px 26px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.wizard-card {
    overflow: hidden;
    border-radius: 24px;
    border-color: #e2e8f0;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
    backdrop-filter: saturate(1.04);
}

.wizard-card-header {
    padding: 20px 22px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e9eef5;
}

.wizard-card-body {
    padding: 18px 20px 22px;
}

#registroWizardRoot {
    min-width: 0;
}

/* --------------------------------------------
   4. BLOQUES VISUALES REUTILIZABLES
-------------------------------------------- */
.panel-intro {
    min-width: 0;
    padding: 16px;
    border-radius: 18px;
}

.panel-intro--compact {
    margin-bottom: 0;
}

.selected-type-inline {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.selected-type-inline__label {
    color: #64748b;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.selected-type-inline__value {
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
}

.summary-card {
    border-color: #e2e8f0;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.check-wrap {
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.check-wrap:hover {
    border-color: rgba(251, 115, 5, 0.3);
    background: #fef9f0;
}

/* --------------------------------------------
   5. STEPPER
-------------------------------------------- */
.wizard-step {
    cursor: pointer;
    border-radius: 18px;
    border-color: #e2e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.2s ease-in-out;
}

.wizard-step:hover {
    transform: translateY(-1px);
    border-color: #fdba74;
    background: #fffaf5;
    box-shadow: 0 10px 22px rgba(251, 115, 5, 0.08);
}

.step-pill {
    transition: all 0.2s ease;
}

.step-pill-active {
    box-shadow: 0 0 0 6px rgba(251, 115, 5, 0.1);
}

.stepper-scroll {
    scrollbar-width: none;
}

.stepper-scroll::-webkit-scrollbar {
    display: none;
}

.wizard-step.border-emerald-200 {
    border-color: #a7f3d0 !important;
}

.wizard-step.bg-emerald-50\/30 {
    background: rgba(209, 250, 229, 0.3) !important;
}

.step-pill i.fa-check {
    font-size: 9px;
}

/* --------------------------------------------
   6. CAMPOS Y ESTADOS
-------------------------------------------- */
.field-group-enhanced {
    position: relative;
    min-width: 0;
}

.field-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.field-chip--required {
    color: #c25504;
    background: #fff7ef;
    border: 1px solid rgba(251, 115, 5, 0.16);
}

.field-chip--optional {
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.wizard-panel input,
.wizard-panel select,
.wizard-panel textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-color: #dbe2ea;
    background: #fff;
    transition: all 0.16s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(251, 115, 5, 0.22) !important;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #fff !important;
    border-color: rgba(251, 115, 5, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(251, 115, 5, 0.1) !important;
    transform: translateY(-1px);
}

input.border-emerald-500,
select.border-emerald-500,
textarea.border-emerald-500 {
    border-color: #86efac !important;
}

input.border-red-500,
select.border-red-500,
textarea.border-red-500 {
    border-color: #fca5a5 !important;
}

.error-text {
    display: none;
}

.error-text:not(.hidden) {
    display: block;
    animation: fadeInUp 0.18s ease;
}

.doc-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin-top: 12px;
    padding: 9px 13px;
    color: #b45309;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    background-color: #fef3c7;
    border: 1px solid rgba(251, 115, 5, 0.16);
    border-radius: 999px;
    transition: all 0.2s ease;
}

.doc-link-btn:hover {
    background-color: #ffedd5;
    border-color: #f59e0b;
    transform: translateY(-1px);
}

.doc-link-btn i {
    font-size: 12px;
}

/* --------------------------------------------
   7. TYPE CARDS
-------------------------------------------- */
.type-card {
    position: relative;
    padding: 17px;
    cursor: pointer;
    border-radius: 18px;
    overflow-wrap: anywhere;
    word-break: break-word;
    will-change: transform, box-shadow, border-color;
    transition: all 0.25s ease;
}

.type-card:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
}

.type-card:focus-visible {
    outline: none;
    border-color: rgba(251, 115, 5, 0.38) !important;
    box-shadow:
        0 0 0 4px rgba(251, 115, 5, 0.1),
        0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.type-card.border-brand-500 {
    border-color: #fb7305 !important;
    background: linear-gradient(180deg, #fff7ef 0%, #ffffff 100%);
    box-shadow: 0 18px 36px rgba(251, 115, 5, 0.12);
}

.type-card > div {
    gap: 16px !important;
    align-items: flex-start !important;
}

.type-card > div > div:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: flex-start !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    margin-top: 2px;
    border-radius: 18px !important;
    border-color: rgba(251, 115, 5, 0.18) !important;
    background: linear-gradient(180deg, #fff7ed 0%, #fff 100%) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 6px 16px rgba(251, 115, 5, 0.08) !important;
}

.type-card > div > div:first-child i {
    display: block;
    line-height: 1 !important;
    font-size: 18px;
}

.type-card > div > div:last-child {
    min-width: 0;
    align-self: flex-start !important;
}

.type-card > div > div:last-child > div:first-child {
    line-height: 1.1 !important;
    letter-spacing: -0.015em;
}

.type-card > div > div:last-child p {
    margin-top: 8px !important;
}

/* --------------------------------------------
   8. MODAL
-------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-card {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.2s ease-out;
}

.doc-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
}

.doc-list li {
    position: relative;
    padding-left: 16px;
}

.doc-list li::before {
    content: "•";
    position: absolute;
    top: 0;
    left: 0;
    color: #fb7305;
    font-weight: 700;
}

/* --------------------------------------------
   9. BOTONES Y BADGES
-------------------------------------------- */
.progress-badge {
    align-self: flex-start;
    justify-content: center;
    min-width: 150px;
    text-align: center;
    white-space: normal;
    border-color: #e2e8f0;
    background: rgba(248, 250, 252, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.wizard-panel button,
.wizard-panel .button,
.wizard-panel .btn {
    cursor: pointer;
    border-radius: 12px;
    letter-spacing: -0.01em;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover:not(:disabled),
.button:hover:not(:disabled),
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled),
.button:active:not(:disabled),
.btn:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled,
.button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.help-chip {
    padding: 7px 12px;
    color: #c25504;
    font-size: 10px;
    border: 1px solid rgba(251, 115, 5, 0.12);
    border-radius: 999px;
    background: rgba(251, 115, 5, 0.08);
}

/* --------------------------------------------
   10. CHECKBOX Y SUCCESS
-------------------------------------------- */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: auto;
    cursor: pointer;
}

#successCard {
    padding: 18px;
    border-radius: 20px;
    animation: fadeInSoft 0.3s ease;
}

/* --------------------------------------------
   11. UTILIDADES
-------------------------------------------- */
.wizard-split-stack {
    gap: 12px;
}

.conditional-block[hidden] {
    display: none !important;
}

/* --------------------------------------------
   12. ANIMACIONES
-------------------------------------------- */
@keyframes fadeInSoft {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --------------------------------------------
   13. RESPONSIVE VISUAL
   Solo se conserva lo estrictamente visual.
   El layout debe resolverse en Tailwind.
-------------------------------------------- */
@media (max-width: 1279px) {
    .wizard-aside .mt-auto {
        margin-top: 28px;
    }

    .wizard-card-header h3 {
        font-size: clamp(1.65rem, 3.8vw, 2rem);
        line-height: 1.15;
    }

    .wizard-card-header p {
        max-width: none;
        font-size: 14px;
        line-height: 1.55;
    }

    .wizard-step {
        padding: 14px !important;
    }

    .progress-badge {
        padding: 10px 14px;
    }
}

@media (max-width: 1023px) {
    main {
        padding: 0 !important;
    }

    .app-card {
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .shared-auth-header__inner {
        max-width: none;
    }

    .shared-auth-header__title {
        font-size: clamp(1.85rem, 4.4vw, 2.3rem);
        line-height: 1.08;
    }

    .shared-auth-header__subtitle {
        font-size: 14px;
        line-height: 1.55;
    }

    .selected-type-inline {
        width: 100%;
        gap: 4px;
        align-items: flex-start;
    }

    .selected-type-inline__label,
    .selected-type-inline__value {
        display: block;
        width: 100%;
    }

    .wizard-panel .field-chip {
        align-self: flex-start;
        white-space: normal;
    }

    .modal-overlay {
        padding: 10px !important;
        align-items: flex-end !important;
    }

    .modal-card {
        width: 100%;
        max-height: 92vh;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }
}

@media (max-width: 767px) {
    body {
        overflow-x: hidden;
        background: #f8fafc !important;
    }

    .app-card {
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .shared-auth-header {
        padding: 16px 14px 14px !important;
        border-bottom: none;
    }

    .shared-auth-header__title {
        max-width: 22ch;
        margin-right: auto;
        margin-left: auto;
        font-size: 16px !important;
        line-height: 1.35 !important;
    }

    .shared-auth-header__subtitle {
        max-width: 34ch;
        margin-right: auto;
        margin-left: auto;
        font-size: 11px !important;
        line-height: 1.5 !important;
    }

    .shared-auth-header__logo {
        width: 46px !important;
        height: 46px !important;
    }

    .wizard-card {
        border-radius: 18px !important;
    }

    .wizard-panel input,
    .wizard-panel select,
    .wizard-panel textarea {
        min-height: 44px;
        padding-left: 12px !important;
        padding-right: 12px !important;
        font-size: 12px !important;
    }

    .type-card {
        min-height: 148px !important;
        padding: 14px !important;
    }

    .type-card > div {
        gap: 14px !important;
    }

    .type-card > div > div:first-child {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        border-radius: 17px !important;
    }

    .wizard-step {
        border-radius: 16px !important;
    }

    .wizard-step .step-pill {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }

    .wizard-panel .rounded-2xl,
    .wizard-panel .rounded-xl,
    .summary-card,
    .type-card {
        border-radius: 16px !important;
    }

    .modal-overlay {
        padding: 0 !important;
    }

    .modal-card {
        max-height: 90dvh !important;
        border-bottom: none !important;
        border-radius: 20px 20px 0 0 !important;
    }

    #stepper .wizard-step .step-pill + span {
        white-space: normal !important;
    }
}

@media (max-width: 480px) {
    .shared-auth-header__logo {
        width: 44px !important;
        height: 44px !important;
    }

    .wizard-panel .field-chip {
        font-size: 9px !important;
    }
}
/* --------------------------------------------
   14. tom-select
-------------------------------------------- */

.ts-wrapper.multi .ts-control {
  min-height: 46px;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  padding: 0.4rem 0.55rem;
  box-shadow: none;
}

.ts-wrapper.focus .ts-control {
  border-color: rgb(249 115 22);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.ts-wrapper .ts-control > div {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0.15rem;
}

.ts-dropdown {
  border-radius: 0.85rem;
  border: 1px solid rgb(226 232 240);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.ts-dropdown .option {
  padding: 0.55rem 0.75rem;
  font-size: 13px;
}

.ts-dropdown .active {
  background: rgb(255 247 237);
  color: rgb(194 65 12);
}

.ts-wrapper.plugin-remove_button .item .remove {
  border-left: none;
  color: rgb(194 65 12);
  font-size: 14px;
  padding-left: 0.35rem;
}