:root {
    --primary-blue: #167ab8;
    --primary-darker: #2a3f54;
    --primary-blue-hover: #167ab8;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --border-light: #e0e0e0;
    --border-blue: #167ab8;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --primary: #1479b8;
    --secondary: #6c757d;
    --dark: #212529;
    --light: #f8f9fa;
    --dark-bg: #1a1d20;
    --darker-bg: #15181b;
    --border-color: #2d3238;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.5;
}

.navbar {
    background-color: var(--white) !important;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    box-shadow: var(--shadow-light);
}

.navbar-brand img {
    height: 50px;
    width: auto;
}

.registration-container {
    background-color: var(--light-gray);
}

.registration-sidebar {
    background-color: var(--primary-darker);
}

.registration-card {
    background: white;
}

.registration-body {
    background: white;
    padding: 20px;
}

.slider-text {
    font-weight: bold;
    transition: opacity 0.6s ease-in-out;
    font-size: 3.0rem;
    color: var(--primary-darker);
    text-shadow: 2px 2px 4px rgba(215, 210, 210, 0.5);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-registration {
    border-radius: 0px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
    width: 100%;
}

.input-registration:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(20, 121, 184, 0.25);
    outline: none;
}

.input-group-text {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-right: none;
}

.password-toggle {
    cursor: pointer;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-left: none;
}

/* Improved error message styling */
.is-invalid {
    border-color: var(--danger) !important;
    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 d='m5.8 3.6.4.4.4-.4'/%3e%3cpath d='M6 7v1'/%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);
    padding-right: 2.5rem;
}

.is-valid {
    border-color: var(--success) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' 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);
    padding-right: 2.5rem;
}

.error-message {
    display: block;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    font-weight: 500;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--danger);
    width: 100%;
    box-sizing: border-box;
}

.success-message {
    display: block;
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    font-weight: 500;
    background-color: rgba(25, 135, 84, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--success);
    width: 100%;
    box-sizing: border-box;
}

.password-strength-container {
    margin-top: 8px;
    margin-bottom: 8px;
}

.password-strength {
    height: 5px;
    border-radius: 5px;
    transition: all 0.3s;
}

.strength-weak {
    background-color: var(--danger);
    width: 25%;
}

.strength-medium {
    background-color: var(--warning);
    width: 50%;
}

.strength-good {
    background-color: #17a2b8;
    width: 75%;
}

.strength-strong {
    background-color: var(--success);
    width: 100%;
}

.password-criteria {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.password-criteria i {
    width: 16px;
    text-align: center;
    margin-right: 5px;
}

.password-criteria.met {
    color: var(--success);
}

.btn-register {
    background: linear-gradient(to right, var(--primary), #0b5ed7);
    border: none;
    padding: 12px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
    color: white;
}

.btn-register:hover {
    background: linear-gradient(to right, #0b5ed7, #0a58ca);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.form-text {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.card {
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Fix for validation display */
.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Alert styling */
.alert {
    border-radius: 8px;
    border: none;
    margin-bottom: 2rem;
    padding: 1rem;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

.captcha-image {
    display: inline-block;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 3px;
    user-select: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .registration-body {
        padding: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .slider-text {
        font-size: 2rem;
    }
}

/* Loading spinner for form submission */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Toast notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* Server validation errors */
.server-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    display: block;
}

.country-select-container {
    position: relative;
}

.country-search-input {
    position: sticky;
    top: 0;
    z-index: 5;
    background: white;
    border-radius: 0.375rem 0.375rem 0 0;
}

.country-dropdown-menu {
    position: absolute;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: none;
}

.country-option {
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.country-option:hover {
    background-color: #f8f9fa;
}

.country-option.selected {
    background-color: #e9ecef;
    font-weight: bold;
}

.no-results {
    padding: 10px 15px;
    color: #6c757d;
    font-style: italic;
}

/* Ensure the container stays visible when dropdown is open */
.country-select-container:focus-within .country-dropdown-menu {
    display: block;
}