/**
 * Frontend registration forms styles for Sleeve KE plugin.
 *
 * @package    Sleeve_KE
 * @subpackage Sleeve_KE/assets/css
 */

/* Registration Form Container */
.sleeve-ke-registration-form {
    max-width: 800px;
    margin: 20px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Registration Header */
.registration-header {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.registration-title {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    color: white;
}

.registration-description {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.5;
}

/* Success and Error Messages */
.registration-success,
.registration-error {
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    margin: 20px;
}

.registration-success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

.registration-error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.success-icon,
.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.registration-success h3,
.registration-error h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
}

.registration-success p,
.registration-error p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.6;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Form Sections */
.form-section {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-child {
    border-bottom: none;
}

.section-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Form Layout */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group .required {
    color: #dc3545;
    font-weight: bold;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 1;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 45px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

/* Checkbox Styling */
.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #0073aa;
    border-color: #0073aa;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label a {
    color: #0073aa;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-family: inherit;
}

.btn-primary {
    background-color: #0073aa;
    color: white;
}

.btn-primary:hover {
    background-color: #005177;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.btn-primary:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-1px);
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
    min-width: 200px;
}

.btn-loading {
    display: none;
}

/* Form Actions */
.form-actions {
    text-align: center;
    padding: 20px 30px;
    background: #f8f9fa;
}

/* Login Link */
.login-link {
    text-align: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.login-link p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.login-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Form Type Specific Styling */
.employer-registration .registration-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.employer-registration .section-title {
    border-bottom-color: #28a745;
}

.employer-registration .form-control:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.employer-registration .btn-primary {
    background-color: #28a745;
}

.employer-registration .btn-primary:hover {
    background-color: #218838;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.employer-registration .checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #28a745;
    border-color: #28a745;
}

.candidate-registration .registration-header {
    background: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
}

.candidate-registration .section-title {
    border-bottom-color: #007bff;
}

.candidate-registration .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.candidate-registration .btn-primary {
    background-color: #007bff;
}

.candidate-registration .btn-primary:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.candidate-registration .checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #007bff;
    border-color: #007bff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sleeve-ke-registration-form {
        margin: 10px;
        border-radius: 0;
    }
    
    .registration-header {
        padding: 20px;
    }
    
    .registration-title {
        font-size: 24px;
    }
    
    .registration-description {
        font-size: 14px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .success-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .registration-header {
        padding: 15px;
    }
    
    .registration-title {
        font-size: 20px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Loading State */
.btn:disabled .btn-text {
    display: none;
}

.btn:disabled .btn-loading {
    display: inline;
}

/* Focus Styles for Accessibility */
.form-control:focus,
.btn:focus,
.checkbox-label:focus-within {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 3px;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .form-control,
    .btn,
    .checkmark {
        transition: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.strength-fill.very-weak {
    background-color: #dc3545;
}

.strength-fill.weak {
    background-color: #fd7e14;
}

.strength-fill.medium {
    background-color: #ffc107;
}

.strength-fill.strong {
    background-color: #28a745;
}

.strength-fill.very-strong {
    background-color: #20c997;
}

.strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #6c757d;
}

/* Field Error Styling */
.form-group.has-error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.field-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Email Check Loading */
.email-check-loading {
    font-size: 12px;
    color: #0073aa;
    margin-left: 8px;
}

/* File Upload Info */
.file-info {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
}

.file-info .dashicons {
    color: #0073aa;
    margin-right: 5px;
}

/* Character Counter */
.char-counter {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.char-counter.warning {
    color: #fd7e14;
    font-weight: 600;
}

/* Loading States */
.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

.btn.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: btn-loading-spin 1s ease-in-out infinite;
}

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

/* Form Validation Animations */
.form-group.has-error .form-control {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Success Icons */
.form-group.has-success .form-control {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.form-group.has-success::after {
    content: "✓";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
}

/* Improved Focus Styles */
.form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    z-index: 1;
    position: relative;
}

/* Better Mobile Experience */
@media (max-width: 768px) {
    .password-strength {
        margin-top: 12px;
    }
    
    .strength-text {
        font-size: 11px;
    }
    
    .field-error {
        font-size: 11px;
    }
    
    .char-counter {
        font-size: 11px;
    }
}