/* Form Validator Styles - Rainify */

:root {
    --validator-success: #22c55e;
    --validator-error: #ef4444;
    --validator-border-normal: rgba(255, 255, 255, 0.1);
}

/* Form Field Container */
.form-field {
    position: relative;
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* Input Base Styles */
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--validator-border-normal);
    border-radius: 12px;
    color: #f8fafc;
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.form-field.field-with-icon input,
.form-field.field-with-icon textarea {
    padding-right: 48px;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #64748b;
}

/* Success State */
.form-field input.field-success,
.form-field textarea.field-success {
    border-color: var(--validator-success);
    background: rgba(34, 197, 94, 0.05);
}

.form-field input.field-success:focus,
.form-field textarea.field-success:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Error State */
.form-field input.field-invalid,
.form-field textarea.field-invalid {
    border-color: var(--validator-error);
    background: rgba(239, 68, 68, 0.05);
}

.form-field input.field-invalid:focus,
.form-field textarea.field-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Field Icon (Check/Error) */
.field-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-field.field-with-icon .field-icon {
    top: calc(50% + 12px);
}

.field-icon.icon-success {
    color: var(--validator-success);
    opacity: 1;
}

.field-icon.icon-error {
    color: var(--validator-error);
    opacity: 1;
}

/* Error Message */
.field-error {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: var(--validator-error);
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.field-error:empty {
    display: none !important;
}

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

/* Submit Button States */
.form-submit {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.form-submit:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.form-submit:active:not(:disabled) {
    transform: translateY(0);
}

.form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #64748b;
    box-shadow: none;
}

/* Loading State */
.form-submit.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Form Helper Text */
.form-helper {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #22c55e;
}

/* Checkbox/Radio Custom Styles */
.form-checkbox,
.form-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 12px;
}

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

.form-checkbox label,
.form-radio label {
    margin: 0;
    font-size: 0.9rem;
    text-transform: none;
    font-weight: 400;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 640px) {
    .form-field input,
    .form-field textarea {
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .form-submit {
        padding: 14px;
        font-size: 0.95rem;
    }
}

/* Focus Visible (Accesibilidad) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
