/* Custom styles for the registration form */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-image: url('images/background-normal.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
}

/* Add overlay for opacity control */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.92); /* Very opaque white overlay */
    z-index: -1;
}

.card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent card background */
    backdrop-filter: blur(5px); /* Slight blur effect for modern browsers */
}

.card-header {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
}

.card-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.8rem;
}

.card-body {
    padding: 2rem;
}

.form-label {
    font-weight: 500;
    color: #343a40;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 0.6rem 0.75rem;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-text {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Address fieldset styling */
fieldset {
    border: 1px solid rgba(13, 110, 253, 0.2);
    padding: 1.25rem;
    border-radius: 8px;
    background-color: rgba(13, 110, 253, 0.05);
    transition: background-color 0.3s ease;
}

/* Styling for the registered address section when auto-filled */
fieldset.auto-filled {
    background-color: rgba(25, 135, 84, 0.05);
    border-color: rgba(25, 135, 84, 0.2);
}

fieldset.auto-filled input {
    background-color: #f8f9fa;
    color: #6c757d;
}

fieldset.auto-filled legend {
    color: #198754;
}

legend.form-label {
    width: auto;
    padding: 0;
    margin-bottom: 16px;
    font-size: 1.1rem;
    color: #0d6efd;
}

/* Same address checkbox styling */
.form-check-label {
    margin-left: 4px;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Special styling for same-address checkbox */
#sameAddress:checked {
    background-color: #198754;
    border-color: #198754;
}

#sameAddress:checked + .form-check-label {
    font-weight: 500;
    color: #198754;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border: none;
    padding: 0.6rem 2.25rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca, #084298);
    transform: translateY(-2px);
}

.btn-secondary {
    padding: 0.6rem 2.25rem;
    border-radius: 6px;
    font-weight: 500;
    background-color: #6c757d;
    border: none;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5c636a;
    transform: translateY(-2px);
}

/* Modal styling */
.modal-content {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
}

.modal-header.bg-success {
    background: linear-gradient(135deg, #198754, #157347) !important;
    border-radius: 8px 8px 0 0;
}

/* Form validation styling */
.invalid-feedback {
    display: block !important;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #dc3545;
}

.form-control.is-invalid, 
.form-select.is-invalid,
.form-check-input.is-invalid {
    border-color: #dc3545;
    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 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%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);
}

.form-check-input.is-invalid {
    border-color: #dc3545;
}

.form-check-input.is-invalid ~ .form-check-label {
    color: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem 1rem;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    fieldset {
        padding: 1rem 0.75rem;
    }
}