/* Registration Form Styles */
body {
    background: linear-gradient(135deg, #FF3AAE 0%, #FF73C3 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
}

/* Add a header to the registration form */
.container::before {
    content: "Create an Account";
    display: block;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Add some branding elements */
.container::after {
    content: "Barangay Uwisan Management System";
    display: block;
    text-align: center;
    margin-top: 30px;
    font-size: 14px;
    color: #6c757d;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
}

h4 {
    color: #333;
    margin-bottom: 25px;
    font-weight: 600;
    border-bottom: 2px solid #2563EB;
    padding-bottom: 10px;
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-control {
    height: 50px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    outline: none;
}

.form-control::placeholder {
    color: #6c757d;
    font-style: normal;
}

.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

select.form-control {
    cursor: pointer;
    background-color: #fff;
}

select.form-control option {
    padding: 10px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    height: auto;
}

.form-btn {
    margin-top: 30px;
    margin-bottom: 20px;
    text-align: center;
}

.btn-primary {
    background-color: #2563EB;
    border: none;
    width: 100%;
    padding: 12px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.text-center {
    text-align: center;
}

.text-center p {
    margin-top: 20px;
    margin-bottom: 10px;
}

.text-center a {
    color: #2563EB;
    text-decoration: none;
    font-weight: 500;
}

.text-center a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Password strength indicator */
.password-strength-meter {
    height: 5px;
    width: 100%;
    background-color: #ddd;
    margin-top: 8px;
    border-radius: 3px;
    overflow: hidden;
}

.password-strength-meter-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
    border-radius: 3px;
}

.strength-weak {
    width: 25%;
    background-color: #dc3545;
}

.strength-medium {
    width: 50%;
    background-color: #ffc107;
}

.strength-strong {
    width: 75%;
    background-color: #28a745;
}

.strength-very-strong {
    width: 100%;
    background-color: #20c997;
}

.password-strength-text {
    font-size: 12px;
    margin-top: 5px;
    color: #6c757d;
}

/* Password visibility toggle */
.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    font-size: 16px;
    z-index: 10;
}

.password-toggle:hover {
    color: #2563EB;
}

/* Email validation icon */
.email-validation-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    z-index: 10;
}

.email-valid {
    color: #28a745;
}

.email-invalid {
    color: #dc3545;
}

/* Password requirements list */
.password-requirements {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.password-requirements ul {
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 0;
}

.requirement-met {
    color: #28a745;
}

.requirement-unmet {
    color: #6c757d;
}

/* Input validation styles */
.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #28a745;
}

.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 5px;
    font-size: 12px;
    color: #dc3545;
}

/* Loading state for submit button */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        height: auto;
        min-height: 100vh;
    }
    
    .container {
        max-width: 100%;
        padding: 20px;
        margin: 10px 0;
        max-height: none;
    }
    
    .container::before {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    h4 {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .form-control {
        height: 45px;
        font-size: 14px;
    }
    
    .btn-primary {
        font-size: 16px;
        padding: 10px;
    }
    
    .row {
        margin: 0;
    }
    
    .col-md-6 {
        padding: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .container::before {
        font-size: 20px;
    }
    
    .form-control {
        height: 40px;
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Animation for form elements */
.form-group {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus effects */
.form-group.focused .form-control {
    border-color: #2563EB;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Custom scrollbar for container */
.container::-webkit-scrollbar {
    width: 6px;
}

.container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.container::-webkit-scrollbar-thumb {
    background: #2563EB;
    border-radius: 3px;
}

.container::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.15rem;
    cursor: pointer;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
    margin-left: 0.5rem;
}

.form-check-label a {
    color: #2563EB;
    text-decoration: none;
    font-weight: 500;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* ========================================
   PASSWORD VALIDATION STYLES - NEW
   ======================================== */

/* Password input wrapper to prevent layout shift */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

/* Reserve space for feedback messages */
.password-feedback,
.password-match-feedback {
    min-height: 60px;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Password validation styles */
.password-mismatch {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

.password-mismatch:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.password-match {
    border-color: #28a745 !important;
    background-color: #f0fff4;
}

.password-match:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Password status icons */
.password-status {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ced4da;
    border-left: none;
    background-color: #fff;
    padding: 0.375rem 0.75rem;
}

.input-group .password-status {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Password feedback messages */
.password-feedback ul {
    list-style-type: none;
    padding-left: 1rem;
    margin-bottom: 0;
    margin-top: 0.25rem;
}

.password-feedback ul li {
    padding: 0.125rem 0;
}

.password-feedback ul li:before {
    content: "• ";
    color: #dc3545;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Input group button styling */
.input-group-text {
    background-color: #fff;
    border-color: #ced4da;
}

.input-group .btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
}

.input-group .btn-outline-secondary:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}

.input-group .btn-outline-secondary:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* Enhanced validation states */
.is-valid {
    border-color: #28a745 !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.is-invalid {
    border-color: #dc3545 !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* For input groups with buttons, adjust the background position */
.input-group .is-valid,
.input-group .is-invalid {
    background-position: right calc(2.5em + 0.1875rem) center;
}

/* Icon animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.password-status i {
    animation: fadeIn 0.3s ease-in-out;
}

/* Responsive adjustments for password validation */
@media (max-width: 768px) {
    .input-group {
        flex-wrap: nowrap;
    }
    
    .password-feedback,
    .password-match-feedback {
        font-size: 0.8rem;
        min-height: 50px;
    }
    
    .password-feedback ul li {
        font-size: 0.75rem;
    }
}

/* Focus states for better accessibility */
.password-mismatch:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.password-match:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Smooth transitions */
.password-status,
.password-feedback,
.password-match-feedback {
    transition: all 0.3s ease;
}
