/* ============================================================================
   THE WIN CAPITAL S.A. - forms.css
   Sistema de formularios, inputs, wizard steps
   ============================================================================ */

/* =======================================================================
   FORM GROUP
   ======================================================================= */

.twc-form-group {
    margin-bottom: var(--twc-space-5);
}

.twc-form-label {
    display: block;
    font-size: var(--twc-text-sm);
    font-weight: var(--twc-font-semibold);
    color: var(--twc-gray-700);
    margin-bottom: var(--twc-space-2);
}

.twc-form-label--required::after {
    content: ' *';
    color: var(--twc-danger);
}

.twc-form-hint {
    display: block;
    font-size: var(--twc-text-xs);
    color: var(--twc-gray-400);
    margin-top: var(--twc-space-1);
}


/* =======================================================================
   INPUTS
   ======================================================================= */

.twc-input {
    display: block;
    width: 100%;
    padding: 12px var(--twc-space-4);
    font-family: var(--twc-font-primary);
    font-size: var(--twc-text-sm);
    font-weight: var(--twc-font-regular);
    color: var(--twc-gray-900);
    background: var(--twc-gray-0);
    border: 1px solid var(--twc-gray-300);
    border-radius: var(--twc-radius-lg);
    transition: border-color var(--twc-transition-fast),
                box-shadow var(--twc-transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.twc-input:focus {
    outline: none;
    border-color: var(--twc-primary);
    box-shadow: 0 0 0 3px rgba(var(--twc-primary-rgb), 0.12);
}

.twc-input::placeholder {
    color: var(--twc-gray-400);
}

.twc-input--lg {
    padding: 16px var(--twc-space-5);
    font-size: var(--twc-text-base);
    border-radius: var(--twc-radius-xl);
}

/* Input con icono */
.twc-input-icon {
    position: relative;
}

.twc-input-icon .twc-input {
    padding-left: calc(var(--twc-space-4) + 24px);
}

.twc-input-icon__icon {
    position: absolute;
    left: var(--twc-space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--twc-gray-400);
    font-size: var(--twc-text-base);
    pointer-events: none;
}

/* Select */
.twc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--twc-space-4) center;
    padding-right: calc(var(--twc-space-4) + 20px);
    cursor: pointer;
}

/* Textarea */
.twc-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Checkbox / Radio custom */
.twc-check {
    display: flex;
    align-items: flex-start;
    gap: var(--twc-space-3);
    cursor: pointer;
    font-size: var(--twc-text-sm);
    color: var(--twc-gray-700);
    line-height: var(--twc-leading-normal);
}

.twc-check input[type="checkbox"],
.twc-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--twc-primary);
    cursor: pointer;
}


/* =======================================================================
   ESTADOS DE VALIDACION
   ======================================================================= */

.twc-input.is-valid {
    border-color: var(--twc-success);
}

.twc-input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(var(--twc-success-rgb), 0.12);
}

.twc-input.is-invalid {
    border-color: var(--twc-danger);
}

.twc-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(var(--twc-danger-rgb), 0.12);
}

.twc-form-error {
    display: none;
    font-size: var(--twc-text-xs);
    color: var(--twc-danger);
    margin-top: var(--twc-space-1);
}

.twc-input.is-invalid ~ .twc-form-error {
    display: block;
}


/* =======================================================================
   FORM WIZARD (Multi-step)
   ======================================================================= */

.twc-wizard {
    max-width: 720px;
    margin: 0 auto;
}

/* Progress bar del wizard */
.twc-wizard__progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--twc-space-10);
    position: relative;
}

.twc-wizard__progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--twc-gray-200);
    z-index: 0;
}

.twc-wizard__progress-fill {
    position: absolute;
    top: 20px;
    left: 40px;
    height: 2px;
    background: var(--twc-primary);
    z-index: 1;
    transition: width var(--twc-transition-base);
}

.twc-wizard__step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--twc-space-2);
    position: relative;
    z-index: 2;
}

.twc-wizard__step-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--twc-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--twc-text-sm);
    font-weight: var(--twc-font-bold);
    background: var(--twc-gray-0);
    border: 2px solid var(--twc-gray-300);
    color: var(--twc-gray-400);
    transition: all var(--twc-transition-base);
}

.twc-wizard__step-indicator.is-active .twc-wizard__step-circle {
    border-color: var(--twc-primary);
    color: var(--twc-primary);
    box-shadow: 0 0 0 4px rgba(var(--twc-primary-rgb), 0.12);
}

.twc-wizard__step-indicator.is-completed .twc-wizard__step-circle {
    background: var(--twc-primary);
    border-color: var(--twc-primary);
    color: var(--twc-gray-900);
}

.twc-wizard__step-label {
    font-size: 11px;
    font-weight: var(--twc-font-medium);
    color: var(--twc-gray-400);
    text-transform: uppercase;
    letter-spacing: var(--twc-tracking-wider);
    white-space: nowrap;
}

.twc-wizard__step-indicator.is-active .twc-wizard__step-label {
    color: var(--twc-primary);
    font-weight: var(--twc-font-semibold);
}

.twc-wizard__step-indicator.is-completed .twc-wizard__step-label {
    color: var(--twc-gray-700);
}

/* Panels del wizard */
.twc-wizard__panel {
    display: none;
    animation: twcFadeInUp 0.4s var(--twc-ease-spring) both;
}

.twc-wizard__panel.is-active {
    display: block;
}

.twc-wizard__panel-title {
    font-size: var(--twc-text-xl);
    font-weight: var(--twc-font-bold);
    color: var(--twc-gray-900);
    margin-bottom: var(--twc-space-2);
}

.twc-wizard__panel-subtitle {
    font-size: var(--twc-text-sm);
    color: var(--twc-gray-500);
    margin-bottom: var(--twc-space-8);
}

/* Navegacion del wizard */
.twc-wizard__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--twc-space-8);
    padding-top: var(--twc-space-6);
    border-top: 1px solid var(--twc-gray-200);
}

.twc-wizard__nav-spacer {
    flex: 1;
}

/* Resumen final */
.twc-wizard__summary {
    background: var(--twc-gray-50);
    border: 1px solid var(--twc-gray-200);
    border-radius: var(--twc-radius-xl);
    padding: var(--twc-space-6);
}

.twc-wizard__summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--twc-space-3) 0;
    font-size: var(--twc-text-sm);
    border-bottom: 1px solid var(--twc-gray-100);
}

.twc-wizard__summary-row:last-child {
    border-bottom: none;
}

.twc-wizard__summary-row dt {
    color: var(--twc-gray-500);
    font-weight: var(--twc-font-regular);
}

.twc-wizard__summary-row dd {
    color: var(--twc-gray-900);
    font-weight: var(--twc-font-semibold);
    text-align: right;
}

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

@media (max-width: 575.98px) {
    .twc-wizard__step-label {
        display: none;
    }

    .twc-wizard__step-circle {
        width: 34px;
        height: 34px;
        font-size: var(--twc-text-xs);
    }

    .twc-wizard__progress::before {
        left: 20px;
        right: 20px;
    }
}