/* Custom styles for enhanced UX - Pure CSS (no @apply) */

/* Input field base styles */
.input-field {
    display: flex;
    height: 2.75rem;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background-color: white;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    transition: all 0.2s ease;
}
.input-field::placeholder {
    color: #9ca3af;
}
.input-field:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.input-field.is-valid {
    border-color: #22c55e;
}
.input-field.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}
.input-field.is-invalid {
    border-color: #ef4444;
}
.input-field.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
.input-field:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Radio button custom styling */
.radio-option {
    position: relative;
    display: flex;
    cursor: pointer;
    align-items: center;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background-color: white;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.radio-option:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(59, 130, 246, 0.05);
}
.radio-option.selected {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 1px #3b82f6;
}
.radio-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.radio-indicator {
    display: flex;
    width: 1.25rem;
    height: 1.25rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
}
.radio-option.selected .radio-indicator {
    border-color: #3b82f6;
}
.radio-indicator::after {
    content: '';
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background-color: #3b82f6;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.radio-option.selected .radio-indicator::after {
    opacity: 1;
}

/* Password strength indicator */
.strength-meter {
    height: 0.375rem;
    width: 100%;
    margin-top: 0.5rem;
    border-radius: 9999px;
    overflow: hidden;
    border: 0;
    appearance: none;
}
.strength-meter::-webkit-progress-bar { background-color: #e5e7eb; }
.strength-meter::-webkit-progress-value { background-color: #64748b; transition: width 0.3s ease; }
.strength-meter::-moz-progress-bar { background-color: #64748b; }
.strength-meter.strength-weak::-webkit-progress-value { background-color: #dc2626; }
.strength-meter.strength-weak::-moz-progress-bar { background-color: #dc2626; }
.strength-meter.strength-fair::-webkit-progress-value { background-color: #c2410c; }
.strength-meter.strength-fair::-moz-progress-bar { background-color: #c2410c; }
.strength-meter.strength-good::-webkit-progress-value { background-color: #a16207; }
.strength-meter.strength-good::-moz-progress-bar { background-color: #a16207; }
.strength-meter.strength-strong::-webkit-progress-value { background-color: #15803d; }
.strength-meter.strength-strong::-moz-progress-bar { background-color: #15803d; }

/* Validation feedback */
.field-feedback {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}
.field-feedback.success { color: #15803d; }
.field-feedback.error { color: #dc2626; }
.field-feedback.info { color: #6b7280; }

/* Password requirements list */
.password-requirements {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.75rem;
}
.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    transition: color 0.2s ease;
}
.requirement.met { color: #15803d; }
.requirement-icon {
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.625rem;
    transition: all 0.2s ease;
}
.requirement:not(.met) .requirement-icon {
    background-color: #e5e7eb;
    color: #9ca3af;
}
.requirement.met .requirement-icon {
    background-color: #22c55e;
    color: white;
}

/* Submit button states */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    height: 3rem;
    padding: 0 1.5rem;
    width: 100%;
    background-color: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.25);
    transition: all 0.2s ease;
    transform: translateY(0);
}
.btn-submit:hover {
    background-color: rgba(59, 130, 246, 0.9);
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}
.btn-submit:focus {
    outline: none;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #3b82f6;
}
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(0);
}
.btn-submit:disabled:hover {
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.25);
}
.btn-submit.loading {
    pointer-events: none;
}

/* Spinner animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Form card animation */
.form-card {
    animation: slideUp 0.5s ease-out;
}
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Error alert animation */
.error-alert {
    animation: shake 0.5s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Toggle password button fix */
.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.375rem;
    border-radius: 0.375rem;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.toggle-password:hover {
    color: #4b5563;
    background-color: #f3f4f6;
}

/* Hidden class */
.hidden {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .form-card,
    .error-alert,
    .spinner {
        animation: none;
    }

    * {
        scroll-behavior: auto !important;
    }
}

.input-field:focus-visible,
.radio-option:has(input:focus-visible),
.toggle-password:focus-visible,
.btn-submit:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}
