/* Auth Container Styles */
.auth-container {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem 0;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.auth-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.auth-subtitle {
    opacity: 0.9;
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
}

.social-login-btn {
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid;
}

.social-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.form-control-modern {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 0.25rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control-modern:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
}

.btn-register {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-register::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s;
}

.btn-register:hover::before {
    left: 100%;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.auth-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    background: rgba(248, 250, 252, 0.8);
}

.auth-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.role-selection-btn {
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.role-selection-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

/* Country Dropdown Styles */
.country-dropdown {
    flex-shrink: 0;
}

.country-dropdown-menu {
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    min-width: 280px;
}

.country-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    border: none;
    background: none;
    width: 100%;
}

.country-option:hover {
    background-color: #f8f9fa;
    color: #333;
}

.country-option.active {
    background-color: #0d6efd;
    color: white;
}

.country-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    flex-shrink: 0;
    display: inline-block;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
}

.country-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
}

.country-code {
    font-size: 12px;
    color: #6c757d;
    font-weight: 400;
    flex-shrink: 0;
}

.country-option.active .country-code {
    color: rgba(255, 255, 255, 0.8);
}

#country-search {
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#country-search:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Phone Input Group Improvements */
.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    flex: 1;
    min-width: 0;
    border-left: 0;
}

.input-group .dropdown {
    border-right: 0;
}

.input-group .btn {
    border-radius: 0.375rem 0 0 0.375rem;
}

.input-group .form-control:focus {
    border-left: 1px solid #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .country-dropdown {
        width: 120px !important;
    }

    .country-dropdown-menu {
        min-width: 260px;
    }

    .input-group {
        flex-direction: row;
    }

    .input-group .form-control {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 576px) {
    .country-dropdown {
        width: 100px !important;
    }

    .country-dropdown-menu {
        min-width: 240px;
    }

    .country-name {
        font-size: 13px;
    }

    .country-code {
        font-size: 11px;
    }
}

/* CAPTCHA Styles */
.captcha-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 15px;
    background-color: #f8f9fa;
}

.captcha-image-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.captcha-image-container img {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    max-width: 150px;
    height: auto;
    display: block;
}

#captcha-image {
    min-width: 100px;
    min-height: 40px;
    background-color: #f8f9fa;
}

#refresh-captcha {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

#refresh-captcha:hover {
    background-color: #e9ecef;
}

/* Error message styling */
.invalid-feedback {
    display: none !important;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
}

.invalid-feedback.show {
    display: block !important;
    visibility: visible !important;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block !important;
    visibility: visible !important;
}

/* Override inline styles for phone validation errors */
.phone-input-group .invalid-feedback {
    display: none !important;
}

.phone-input-group .invalid-feedback.show {
    display: block !important;
    visibility: visible !important;
}

.phone-input-group .form-control.is-invalid ~ .invalid-feedback {
    display: block !important;
    visibility: visible !important;
}

.role-card {
    border: 2px solid #e0e0e0;
    border-radius: 1rem;
    background: #fff;
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
    min-width: 220px;
    max-width: 260px;
    min-height: 170px;
    padding: 0;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
}
.role-card.active,
.role-card:focus,
.role-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 24px 0 rgba(13, 110, 253, 0.1);
    background: #f5faff;
}
.role-card-body {
    padding: 1.2rem 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
}
.role-card .fw-bold {
    font-size: 1.1rem;
    margin-bottom: 2px;
}
.role-desc {
    font-size: 0.95rem;
    color: #6c757d;
    margin-top: 0.25rem;
}
.role-card .bi-info-circle-fill {
    cursor: pointer;
    font-size: 1.1rem;
}
@media (max-width: 767.98px) {
    .role-card {
        min-width: 100%;
        max-width: 100%;
    }
}

.compact-auth-header {
    padding-top: 0.7rem !important;
    padding-bottom: 0.5rem !important;
}
.compact-auth-header .auth-title {
    font-size: 1.45rem !important;
    margin-bottom: 0.2rem !important;
}
.compact-auth-header .auth-subtitle {
    font-size: 1rem !important;
    margin-bottom: 0 !important;
    color: #ffffff !important;
}

@media (max-width: 600px) {
    .compact-role-modal-dialog {
        margin: 0 !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        display: flex;
        align-items: flex-start;
    }
    .compact-role-modal {
        min-width: 100vw !important;
        max-width: 100vw !important;
        margin: 0;
        border-radius: 0 !important;
        height: 100vh !important;
        display: flex;
        flex-direction: column;
    }
    .compact-role-modal .modal-header {
        border-radius: 0 !important;
    }
    .compact-role-modal .modal-body {
        padding: 0.7rem 0.5rem !important;
        flex: 1 1 auto;
        overflow-y: auto !important;
        max-height: none !important;
    }
    .compact-role-modal .role-selection-btn {
        font-size: 0.97rem !important;
        padding: 0.7rem 0.5rem !important;
    }
    .compact-role-modal .fw-bold {
        font-size: 1.01rem !important;
    }
}
@media (min-width: 601px) {
    .modal-dialog {
        margin-top: 1.5rem !important;
    }
}
