/* CVC Authentication Modal Styles */

/* Bricks Builder Specific Styles */
.cvc-auth-content {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
}

.brxe-popup .cvc-auth-content,
.bricks-popup .cvc-auth-content {
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100%;
}

/* Ensure forms are visible in Bricks */
.cvc-auth-content .cvc-auth-logged-out,
.cvc-auth-content .cvc-auth-logged-in {
    display: block;
    width: 100%;
}

.cvc-auth-content .cvc-login-form,
.cvc-auth-content .cvc-register-form {
    display: block;
    width: 100%;
}

/* Remove modal-specific styles when in Bricks */
.cvc-auth-content .cvc-auth-modal-overlay,
.cvc-auth-content .cvc-auth-modal-close {
    display: none;
}

/* Bricks modal padding adjustments */
.brxe-popup .cvc-auth-content .cvc-auth-logged-out,
.brxe-popup .cvc-auth-content .cvc-auth-logged-in,
.bricks-popup .cvc-auth-content .cvc-auth-logged-out,
.bricks-popup .cvc-auth-content .cvc-auth-logged-in {
    padding: 15px;
}

/* Ensure form visibility in Bricks */
.cvc-auth-content .cvc-form-container {
    display: none;
}

.cvc-auth-content .cvc-form-container.active {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

/* Fix button spacing in Bricks */
.cvc-auth-content .btn-primary,
.cvc-auth-content .btn-secondary,
.cvc-auth-content .btn-google {
    margin-bottom: 12px;
}

/* Ensure form groups are properly spaced */
.cvc-auth-content .cvc-form-group {
    margin-bottom: 16px;
}

:root {
    --cvc-primary-color: #0073aa;
    --cvc-secondary-color: #005177;
    --cvc-success-color: #46b450;
    --cvc-error-color: #dc3232;
    --cvc-warning-color: #ffb900;
    --cvc-text-color: #23282d;
    --cvc-light-text: #666;
    --cvc-border-color: #ddd;
    --cvc-bg-color: #fff;
    --cvc-overlay-color: rgba(0, 0, 0, 0.6);
    --cvc-radius: 8px;
    --cvc-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --cvc-transition: all 0.3s ease;
}

/* Screen reader only class */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Body scroll lock */
body.cvc-modal-open {
    overflow: hidden;
}

/* Modal Base Styles */
.cvc-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--cvc-transition);
}

.cvc-auth-modal.cvc-active {
    opacity: 1;
    visibility: visible;
}

.cvc-auth-modal.cvc-hidden {
    opacity: 0;
    visibility: hidden;
}

.cvc-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cvc-overlay-color);
    cursor: pointer;
}

.cvc-auth-modal-container {
    position: relative;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    background: var(--cvc-bg-color);
    border-radius: var(--cvc-radius);
    box-shadow: var(--cvc-shadow);
    overflow-y: auto;
    transform: translateY(-20px);
    transition: var(--cvc-transition);
}

.cvc-auth-modal.cvc-active .cvc-auth-modal-container {
    transform: translateY(0);
}

/* Modal Close Button */
.cvc-auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--cvc-light-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--cvc-transition);
    z-index: 10;
}

.cvc-auth-modal-close:hover,
.cvc-auth-modal-close:focus {
    background: #f0f0f0;
    color: var(--cvc-text-color);
    outline: 2px solid var(--cvc-primary-color);
    outline-offset: 2px;
}

/* Modal Content Areas */
.cvc-auth-logged-out,
.cvc-auth-logged-in {
    padding: 30px;
}

/* Modal Title */
.cvc-auth-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--cvc-text-color);
    margin: 0 0 25px 0;
    text-align: center;
    line-height: 1.3;
}

/* Form Container Styles */
.cvc-auth-forms {
    width: 100%;
}

.cvc-form-container {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.cvc-form-container.active {
    display: block !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.cvc-login-form,
.cvc-register-form {
    width: 100%;
}

.cvc-form-group {
    margin-bottom: 20px;
}

.cvc-form-label {
    display: block;
    font-weight: 400;
    color: #3c4043;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.cvc-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.cvc-form-input::placeholder {
    color: #9aa0a6;
    font-size: 16px;
}

.cvc-form-input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 1px 6px rgba(66, 133, 244, 0.15);
}

.cvc-form-input:hover {
    border-color: #c1c7cd;
}

.cvc-form-input:invalid {
    border-color: var(--cvc-error-color);
}

.cvc-form-help {
    display: block;
    font-size: 12px;
    color: var(--cvc-light-text);
    margin-top: 5px;
    line-height: 1.4;
}

/* Checkbox Styles */
.cvc-checkboxes {
    margin: 20px 0;
}

.cvc-checkbox-label {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: var(--cvc-text-color);
    line-height: 1.4;
    margin-bottom: 10px;
    cursor: pointer;
}

.cvc-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.cvc-checkbox-label a {
    color: var(--cvc-primary-color);
    text-decoration: none;
}

.cvc-checkbox-label a:hover {
    text-decoration: underline;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-google {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--cvc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 16px;
    position: relative;
    border: 1px solid transparent;
}

.btn-primary {
    background: #4285f4;
    color: #fff;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover,
.btn-primary:focus {
    background: #3367d6;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
    outline: none;
}

.btn-secondary {
    background: #f8f9fa;
    color: var(--cvc-text-color);
    border: 1px solid #dadce0;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #f1f3f4;
    border-color: #c1c7cd;
    outline: none;
}

.btn-google {
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.btn-google:hover,
.btn-google:focus {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-color: #c1c7cd;
    outline: none;
}

.google-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #4285f4;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider Styles */
.cvc-divider {
    position: relative;
    margin: 24px 0;
    text-align: center;
}

.cvc-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dadce0;
}

.cvc-divider-text {
    position: relative;
    background: var(--cvc-bg-color);
    padding: 0 16px;
    color: #5f6368;
    font-size: 14px;
    font-weight: 400;
}

/* Loading State */
.cvc-loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.cvc-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Form Footer */
.cvc-form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 0;
    border: none;
}

.cvc-switch-link {
    font-size: 14px;
    color: #5f6368;
    line-height: 1.4;
}

.cvc-link-btn {
    background: none;
    border: none;
    color: #4285f4;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cvc-link-btn:hover,
.cvc-link-btn:focus {
    color: #3367d6;
    text-decoration: underline;
    outline: none;
}

.cvc-forgot-password {
    color: var(--cvc-primary-color);
    text-decoration: none;
    font-size: 14px;
}

.cvc-forgot-password:hover {
    text-decoration: underline;
}

.cvc-google-help {
    text-align: center;
    display: block;
    margin-top: -10px;
    margin-bottom: 15px;
}

/* Logged In View */
.cvc-user-greeting {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--cvc-border-color);
}

.cvc-user-greeting h2 {
    margin: 0 0 10px 0;
    color: var(--cvc-text-color);
}

.cvc-verification-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.cvc-verification-badge.verified {
    background: rgba(70, 180, 80, 0.1);
    color: var(--cvc-success-color);
}

/* User Navigation */
.cvc-user-nav {
    margin-bottom: 25px;
}

.cvc-user-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cvc-user-links li {
    margin-bottom: 8px;
}

.cvc-user-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--cvc-text-color);
    text-decoration: none;
    border-radius: var(--cvc-radius);
    transition: var(--cvc-transition);
    border: 1px solid transparent;
}

.cvc-user-link:hover,
.cvc-user-link:focus {
    background: rgba(0, 115, 170, 0.05);
    border-color: var(--cvc-border-color);
    outline: none;
}

.cvc-user-link:focus {
    outline: 2px solid var(--cvc-primary-color);
    outline-offset: 2px;
}

.cvc-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--cvc-light-text);
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* User Actions */
.cvc-user-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--cvc-border-color);
}

.cvc-logout-btn {
    width: auto;
    min-width: 140px;
    margin-bottom: 0;
}

/* Messages */
.cvc-message {
    position: relative;
    margin-bottom: 20px;
    padding: 15px 45px 15px 15px;
    border-radius: var(--cvc-radius);
    font-size: 14px;
    line-height: 1.4;
}

.cvc-message--success {
    background: rgba(70, 180, 80, 0.1);
    color: var(--cvc-success-color);
    border: 1px solid rgba(70, 180, 80, 0.3);
}

.cvc-message--error {
    background: rgba(220, 50, 50, 0.1);
    color: var(--cvc-error-color);
    border: 1px solid rgba(220, 50, 50, 0.3);
}

.cvc-message--warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.cvc-message--info {
    background: rgba(13, 110, 253, 0.1);
    color: #055160;
    border: 1px solid rgba(13, 110, 253, 0.3);
}

.cvc-message__close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: currentColor;
    opacity: 0.7;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.cvc-message__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Resend verification button in messages */
.cvc-message [data-action="resend_verification"] {
    display: inline-block;
    width: auto;
    margin-top: 10px;
    margin-bottom: 0;
    padding: 8px 16px;
    font-size: 13px;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border: 1px solid currentColor;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--cvc-transition);
}

.cvc-message--error [data-action="resend_verification"] {
    background: rgba(255, 255, 255, 0.9);
    color: var(--cvc-error-color);
}

.cvc-message--error [data-action="resend_verification"]:hover,
.cvc-message--error [data-action="resend_verification"]:focus {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 50, 50, 0.2);
    outline: 2px solid var(--cvc-error-color);
    outline-offset: 1px;
}

.cvc-message [data-action="resend_verification"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cvc-message__text {
    display: block;
    margin-bottom: 5px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .cvc-auth-modal-container {
        width: 95%;
        margin: 10px;
    }
    
    .cvc-auth-logged-out,
    .cvc-auth-logged-in {
        padding: 20px;
    }
    
    .cvc-auth-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    
    .btn-primary,
    .btn-secondary,
    .btn-google {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --cvc-border-color: #000;
        --cvc-light-text: #333;
    }
    
    .cvc-form-input:focus {
        box-shadow: 0 0 0 3px #000;
    }
    
    .btn-primary:focus,
    .btn-secondary:focus,
    .btn-google:focus {
        outline: 3px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cvc-auth-modal,
    .cvc-auth-modal-container,
    .cvc-form-input,
    .btn-primary,
    .btn-secondary,
    .btn-google {
        transition: none;
    }
    
    .cvc-form-container {
        animation: none;
    }
    
    .cvc-loading::after {
        animation: none;
    }
}