/**
 * Estilos del área pública de Flow Multiphase Form
 * Diseño moderno con gradientes y animaciones
 */

/* Variables de colores */
:root {
    --fmf-primary: #667eea;
    --fmf-primary-dark: #5568d3;
    --fmf-secondary: #764ba2;
    --fmf-success: #48bb78;
    --fmf-danger: #f56565;
    --fmf-warning: #ed8936;
    --fmf-light: #f7fafc;
    --fmf-dark: #2d3748;
    --fmf-border: #e2e8f0;
    --fmf-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --fmf-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Contenedor principal del formulario */
.fmf-form-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: var(--fmf-bg, white);
    border-radius: 16px;
    box-shadow: var(--fmf-shadow-lg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header del formulario */
.fmf-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.fmf-form-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 18px 0;
}

.fmf-form-logo {
    display: block;
    max-width: 180px;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.fmf-form-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--fmf-dark);
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, var(--fmf-primary) 0%, var(--fmf-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fmf-form-description {
    font-size: 16px;
    color: #718096;
    margin: 0;
}

/* Indicador de progreso */
.fmf-progress-container {
    margin-bottom: 40px;
}

.fmf-progress-bar {
    height: 8px;
    background: var(--fmf-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.fmf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--fmf-primary) 0%, var(--fmf-secondary) 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fmf-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.fmf-progress-step {
    flex: 1;
    text-align: center;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.fmf-progress-step.active {
    opacity: 1;
}

.fmf-progress-step.completed {
    opacity: 0.8;
}

.fmf-step-number {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    background: var(--fmf-light);
    border: 2px solid var(--fmf-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #718096;
    transition: all 0.3s ease;
}

.fmf-progress-step.active .fmf-step-number {
    background: linear-gradient(135deg, var(--fmf-primary) 0%, var(--fmf-secondary) 100%);
    border-color: transparent;
    color: white;
    transform: scale(1.1);
}

.fmf-progress-step.completed .fmf-step-number {
    background: var(--fmf-success);
    border-color: transparent;
    color: white;
}

.fmf-progress-step.completed .fmf-step-number::before {
    content: "✓";
}

.fmf-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
}

.fmf-progress-step.active .fmf-step-label {
    color: var(--fmf-primary);
}

/* Contenedor de fase */
.fmf-phase-container {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.fmf-phase-container.active {
    display: block;
}

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

/* Header de fase */
.fmf-phase-header {
    margin-bottom: 30px;
}

.fmf-phase-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--fmf-dark);
    margin: 0 0 10px 0;
}

.fmf-phase-description {
    font-size: 15px;
    color: #718096;
    margin: 0;
}

/* Campos del formulario */
.fmf-phase-fields {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.fmf-field-group {
    display: flex;
    flex-direction: column;
}

.fmf-field-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--fmf-dark);
    margin-bottom: 8px;
    display: block;
}

.fmf-required {
    color: var(--fmf-danger);
    margin-left: 4px;
}

.fmf-field-description {
    font-size: 13px;
    color: #718096;
    margin: 0 0 8px 0;
}

/* Inputs */
.fmf-field-input,
.fmf-field-textarea,
.fmf-field-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--fmf-dark);
    background: white;
    border: 2px solid var(--fmf-border);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.fmf-field-select {
    min-height: 52px;
    line-height: 1.4;
    padding-right: 42px;
    text-indent: 0;
    -webkit-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--fmf-dark) 50%), linear-gradient(135deg, var(--fmf-dark) 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.fmf-field-select option {
    color: var(--fmf-dark);
}

.fmf-field-input:focus,
.fmf-field-textarea:focus,
.fmf-field-select:focus {
    outline: none;
    border-color: var(--fmf-primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.fmf-field-input.error,
.fmf-field-textarea.error,
.fmf-field-select.error {
    border-color: var(--fmf-danger);
}

.fmf-field-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Radio y Checkbox */
.fmf-field-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fmf-radio-label,
.fmf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--fmf-light);
    border: 2px solid var(--fmf-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fmf-radio-label:hover,
.fmf-checkbox-label:hover {
    background: #edf2f7;
    border-color: var(--fmf-primary);
}

.fmf-radio-label input[type="radio"],
.fmf-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.fmf-radio-label span,
.fmf-checkbox-label span {
    font-size: 15px;
    color: var(--fmf-dark);
    flex: 1;
}

/* Mensaje de error */
.fmf-field-error {
    color: var(--fmf-danger);
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.fmf-field-error.show {
    display: block;
}

/* Navegación del formulario */
.fmf-form-navigation {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    justify-content: space-between;
}

/* Botones */
.fmf-btn {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fmf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fmf-btn-primary {
    background: linear-gradient(135deg, var(--fmf-primary) 0%, var(--fmf-secondary) 100%);
    color: white;
    box-shadow: var(--fmf-shadow);
}

.fmf-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--fmf-shadow-lg);
}

.fmf-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.fmf-btn-secondary {
    background: var(--fmf-primary);
    color: #ffffff !important;
    border: 2px solid var(--fmf-primary);
    box-shadow: var(--fmf-shadow);
}

.fmf-btn-secondary:hover:not(:disabled) {
    background: var(--fmf-primary-dark);
    border-color: var(--fmf-primary-dark);
    color: #ffffff !important;
}

.fmf-btn-prev {
    margin-right: auto;
}

.fmf-btn-next,
.fmf-btn-submit {
    margin-left: auto;
}

/* Mensajes */
.fmf-form-messages {
    margin-top: 20px;
}

.fmf-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fmf-message-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid var(--fmf-success);
}

.fmf-message-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid var(--fmf-danger);
}

.fmf-message-info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid var(--fmf-info);
}

/* Loading spinner */
.fmf-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .fmf-form-container {
        padding: 30px 20px;
        margin: 20px 10px;
    }

    .fmf-form-title {
        font-size: 26px;
    }

    .fmf-phase-title {
        font-size: 20px;
    }

    .fmf-progress-steps {
        flex-wrap: wrap;
    }

    .fmf-step-label {
        font-size: 11px;
    }

    .fmf-step-number {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .fmf-form-navigation {
        flex-direction: column;
    }

    .fmf-btn-prev,
    .fmf-btn-next,
    .fmf-btn-submit {
        width: 100%;
        margin: 0;
    }
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.fmf-submitting .fmf-btn-submit {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Accesibilidad */
.fmf-field-input:focus-visible,
.fmf-field-textarea:focus-visible,
.fmf-field-select:focus-visible,
.fmf-btn:focus-visible {
    outline: 3px solid var(--fmf-primary);
    outline-offset: 2px;
}


@media (max-width: 640px) {
    .fmf-form-logo {
        max-width: 140px;
        max-height: 90px;
    }
}
