/* Client Authentication Styles */

/* Auth form styling */
.auth-form-separator {
    text-align: center;
    margin-top: 24px;
}

.auth-form-separator hr {
    margin-bottom: 16px;
    border: 1px solid #cdcdcd;
}

.auth-form-separator-text {
    font-family: 'Proxima Nova SemiBold', sans-serif;
    padding: 0 0 10px;
    font-size: 16px;
    color: #676767;
}

.auth-form-contact-link {
    font-size: 20px;
    font-weight: 400;
    color: #c37602;
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
}

.auth-form-contact-link:hover {
    text-decoration: underline;
}

/* Password field specific styles */
.password-field-container {
    position: relative;
    margin-bottom: 1.5rem; /* Normal spacing when card is hidden */
    transition: margin-bottom 0.3s ease;
}

.password-field-container.show-card {
    margin-bottom: 3rem !important; /* Extra space only when card is visible */
}

.form-group.password-field-container {
    margin-bottom: 1.5rem;
    transition: margin-bottom 0.3s ease;
}

.form-group.password-field-container.show-card {
    margin-bottom: 3rem !important;
}

.floating-label.password-field-container {
    margin-bottom: 1.5rem;
    transition: margin-bottom 0.3s ease;
}

.floating-label.password-field-container.show-card {
    margin-bottom: 3rem !important;
}

.password-field-container:last-of-type {
    margin-bottom: 1.5rem;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
}

/* Password card styles */
.password-card {
    position: absolute;
    /* top: calc(100% + 12px); */
    left: 0;
    right: 0;
    background: white !important;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    margin-top: 0;
    min-width: 280px;
    max-width: 100%;
}

/* Ensure form elements don't interfere with password card */
.form-group.password-field-container ~ .form-group {
    position: relative;
    z-index: 1;
}

.password-card ul {
    margin: 0;
    font-size: 0.9rem;
    list-style: none;
    padding: 0;
    background: white !important;
    width: 100%;
}

.password-card li {
    padding: 6px 0;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 24px;
    background: white !important;
}

.password-card li::before {
    content: '✗';
    position: absolute;
    left: 0;
    margin-right: 8px;
    font-weight: bold;
    color: #dc3545;
    transition: all 0.3s ease;
    width: 16px;
    text-align: center;
}

/* When JavaScript sets color to green, show checkmark */
.password-card li[style*="green"]::before,
.password-card li[style*="color: green"]::before {
    content: '✓';
    color: #28a745 !important;
}

/* Password match indicator */
.match-message {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 4px 0;
}

.match-message.match {
    color: #28a745;
    opacity: 1;
}

.match-message.no-match {
    color: #dc3545;
    opacity: 1;
}

/* Info message styling */
.info-message {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #004085;
    font-size: 0.9rem;
}

.info-message a {
    color: #0056b3;
    text-decoration: none;
}

.info-message a:hover {
    text-decoration: underline;
}

/* Readonly field styling */
.readonly {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .password-card {
        font-size: 0.85rem;
        padding: 0.75rem;
        min-width: 240px;
    }
    
    .password-card li {
        padding: 3px 0;
    }
    
    .auth-form-separator-text {
        font-size: 14px;
    }
    
    .auth-form-contact-link {
        font-size: 18px;
    }
    
    .password-field-container {
        margin-bottom: 1.25rem;
    }
    
    .password-field-container.show-card {
        margin-bottom: 2.5rem;
    }
    
    .form-group.password-field-container {
        margin-bottom: 1.25rem;
    }
    
    .form-group.password-field-container.show-card {
        margin-bottom: 2.5rem;
    }
    
    .password-field-container:last-of-type {
        margin-bottom: 1.25rem;
    }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error feedback */
.feedback-message {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.feedback-message.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.feedback-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.feedback-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Terms and Conditions Acceptance Section */
.tc-acceptance-section {
    margin: 1.5rem 0;
    padding: 1rem 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    position: relative;
    margin: 0;
    flex-shrink: 0;
    margin-top: 1px; /* Fine-tune vertical alignment */
    
    transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.checkbox-wrapper input[type="checkbox"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.checkbox-wrapper label {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    cursor: pointer;
    margin: 0;
    flex: 1;
    display: block;
}

.tc-text {
    display: inline;
    line-height: 1.4;
}

.tc-link {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tc-link:hover {
    border-bottom-color: #007bff;
    color: #0056b3;
}

.tc-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 2px;
}

.error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 0.5rem;
    padding-left: 30px;
    font-weight: 500;
}

/* Animation for error message */
.error-message[style*="block"] {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
