/* Unified Login System Styles */

/* Page Background */
body.unified-login-page,
.unified-login-page {
    background: linear-gradient(135deg, #000000 0%, #8b0000 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure it overrides any other background styles */
body.unified-login-page {
    background: linear-gradient(135deg, #000000 0%, #8b0000 100%) !important;
}

/* Login Container - always has card styling */
.unified-login-container {
    background: #1a1a1a !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    padding: 2rem !important;
    max-width: 400px !important;
    width: 90% !important;
    border: 1px solid #333 !important;
    margin: 0 auto;
}

/* Ensure unified-login-container keeps styling in modals too */
.modal .unified-login-container,
.modal-content .unified-login-container,
.modal-body .unified-login-container {
    background: #1a1a1a !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    padding: 2rem !important;
    max-width: 400px !important;
    width: 90% !important;
    border: 1px solid #333 !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Ensure modal-content itself is completely invisible when containing unified login */
.modal-content:has(.unified-login-container),
.modal-content.unified-login-modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Also ensure modal-body doesn't add padding and allows centering */
.modal-body:has(.unified-login-container),
.modal-body.p-0:has(.unified-login-container) {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Login Header */
.unified-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.unified-login-header img {
    height: 120px;
    margin-bottom: 1.5rem;
}

.unified-login-header h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.unified-login-header p {
    color: #ccc;
}

/* Form Fields */
.unified-login-field {
    margin-bottom: 1rem;
}

.unified-login-field.hidden {
    display: none;
}

/* Popsicle Stick Input Style */
.unified-login-input {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 50px !important;
    color: white;
    padding: 0.75rem 1rem;
    padding-right: 50px;
    width: 100%;
    font-size: 1rem;
}

/* When send button is hidden, adjust padding */
.unified-input-with-button:has(.unified-btn-circle.hidden) .unified-login-input {
    padding-right: 1rem;
}

.unified-login-input:focus {
    background: #2a2a2a;
    border-color: #007bff;
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.unified-login-input::placeholder {
    color: #999;
}

/* Input with Button Container */
.unified-input-with-button {
    position: relative;
    width: 100%;
}

/* Circle Icon Buttons */
.unified-btn-circle {
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.unified-btn-circle:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Grey (disabled) button state */
.unified-btn-circle.btn-grey {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff;
}

/* Blue (active) button state */
.unified-btn-circle.btn-blue {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff;
}

.unified-btn-circle.btn-blue:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

/* Pulse Animation for Button */
@keyframes unifiedPulseButton {
    0% {
        transform: translateY(-50%) scale(1);
        filter: saturate(100%) brightness(100%);
    }
    50% {
        transform: translateY(-50%) scale(1.15);
        filter: saturate(150%) brightness(120%);
    }
    100% {
        transform: translateY(-50%) scale(1);
        filter: saturate(100%) brightness(100%);
    }
}

/* Pulse animation for buttons not positioned absolutely (like in forgot options) */
@keyframes unifiedPulseButtonRelative {
    0% {
        transform: scale(1);
        filter: saturate(100%) brightness(100%);
    }
    50% {
        transform: scale(1.15);
        filter: saturate(150%) brightness(120%);
    }
    100% {
        transform: scale(1);
        filter: saturate(100%) brightness(100%);
    }
}

.unified-btn-circle.pulse-button {
    animation: unifiedPulseButton 1.5s ease-in-out infinite;
}

.unified-btn-circle.pulse-button:hover {
    animation: none;
    transform: translateY(-50%) scale(1.1);
}

/* Ensure hidden buttons don't show pulse animation */
.unified-btn-circle.hidden {
    display: none !important;
    animation: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Hide contact send button when in step 3 (forgot password flow) */
#unified-contact-send-btn.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    animation: none !important;
}

/* Hide contact send button input container in step 3 */
.unified-login-field:has(.unified-btn-circle.hidden) .unified-input-with-button {
    padding-right: 1rem;
}

/* Pulse animation for buttons in forgot options - now uses same animation as input buttons */
.unified-forgot-option-wrapper .unified-btn-circle.pulse-button {
    animation: unifiedPulseButton 1.5s ease-in-out infinite;
}

.unified-forgot-option-wrapper .unified-btn-circle.pulse-button:hover {
    animation: none;
    transform: translateY(-50%) scale(1.1);
}

/* Password Options Row */
.unified-password-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

/* Checkbox Wrapper */
.unified-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #ccc;
    cursor: pointer;
    user-select: none;
}

.unified-checkbox-wrapper label {
    margin: 0;
    cursor: pointer;
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.2;
}

/* Checkbox with Blue Background and White Checkmark */
.unified-checkbox-circle {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #007bff;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin: 0;
    transition: all 0.2s ease;
}

.unified-checkbox-circle:hover {
    border-color: #0056b3;
}

.unified-checkbox-circle:checked {
    background: #007bff;
    border-color: #007bff;
}

.unified-checkbox-circle:checked::after {
    content: '✓';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.unified-checkbox-circle:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Forgot Password Button - styled like "Not Verified" badge */
.unified-forgot-password-btn {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    background-color: #6c757d;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.unified-forgot-password-btn:hover {
    background-color: #5a6268;
    color: #fff;
}

/* Forgot Password Options */
.unified-forgot-options {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem;
    margin-top: 1rem;
}

.unified-forgot-option-wrapper {
    width: 100%;
}

/* Style the option div to look like popsicle stick input */
.unified-forgot-option-div {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 50px !important;
    color: white;
    padding: 0.75rem 1rem;
    padding-right: 50px;
    width: 100%;
    font-size: 1rem;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    cursor: pointer;
    min-height: 48px;
}

.unified-forgot-option-div:hover {
    border-color: #007bff;
    background: #2a2a2a;
}

.unified-forgot-option-div.selected {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Send button inside option wrapper - positioned like input field buttons */
.unified-forgot-option-wrapper .unified-input-with-button {
    position: relative;
    width: 100%;
}

.unified-forgot-option-wrapper .unified-btn-circle {
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
}

/* Error Message */
.unified-login-error {
    background: #721c24;
    border: 1px solid #721c24;
    color: #f8d7da;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
    display: none;
}

.unified-login-error.show {
    display: block;
}

/* Status Badge */
.unified-status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.unified-status-badge.bg-secondary {
    background: #6c757d;
    color: white;
}

/* Loading State */
.unified-btn-circle.loading {
    pointer-events: none;
}

.unified-btn-circle.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .unified-login-container {
        padding: 1.5rem;
        width: 95%;
    }
    
    .unified-login-header img {
        height: 100px;
    }
}

