:root {
    --primary-blue: #2B5EE8;
    --primary-blue-hover: #1E4ED8;
    --primary-blue-light: #4A7AFA;
    --bg-gray: #F5F7FA;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --white: #FFFFFF;
    --success-green: #005F54;
    --danger-red: #A03E21;
    --warning-orange: #C2410C; /* WCAG AA Compliant Contrast Dark Orange */
}

body.dark-mode {
    --primary-blue: #3B82F6;
    --primary-blue-hover: #60A5FA;
    --primary-blue-light: #93C5FD;
    --bg-gray: #111827;
    --text-dark: #F9FAFB;
    --text-muted: #9CA3AF;
    --border-color: #374151;
    --white: #1F2937;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100vh;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-blue-hover);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input {
    font-family: inherit;
    outline: none;
}

/* Accessibility: Global Focus States */
*:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 2px;
    z-index: 100;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.w-full {
    width: 100%;
}

/* --- Google Translate Overrides (Aggressive) --- */
#google_translate_element {
    position: absolute;
    top: -10000px;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

body {
    top: 0px !important; 
}

.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

iframe.goog-te-banner-frame {
    display: none !important;
}

/* Hide the new Google Translate banner class */
.VIpgJd-ZVi9od-ORHb-OEVmcd {
    display: none !important;
}

/* Hide hover popups for original text */
#goog-gt-tt, .goog-te-balloon-frame, .goog-tooltip {
    display: none !important;
}
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Custom Language Dropdown */
.lang-dropdown-wrapper {
    position: relative;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
}

.lang-dropdown-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lang-dropdown-btn:hover {
    background: var(--white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 460px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.lang-dropdown-wrapper.active .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.lang-option:hover {
    background-color: var(--bg-gray);
    color: var(--primary-blue);
}

body.dark-mode .lang-dropdown-btn {
    background: rgba(31, 41, 55, 0.7);
}

/* --- Auth Layout --- */
.auth-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-gray);
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    /* Simulate the image proportions */
    min-height: 700px;
}

.auth-sidebar {
    background: var(--primary-blue);
    color: var(--white);
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Circular Background Shapes */
.auth-sidebar::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.auth-sidebar::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.auth-sidebar h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 10;
    line-height: 1.2;
}

.auth-sidebar p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 420px;
    position: relative;
    z-index: 10;
    line-height: 1.6;
}

.auth-content {
    background-color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
}

.auth-form-container h2 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.auth-form-container .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: var(--white);
    color: var(--text-dark);
}

select.form-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.2em !important;
    padding-right: 2.75rem !important;
}

input[type="date"].form-input {
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #9CA3AF;
    font-weight: 500;
}

.form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(43, 94, 232, 0.1);
}

.password-toggle {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-blue);
    color: var(--white);
    font-weight: 600;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-blue-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.auth-separator {
    margin: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.admin-portal-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.admin-portal-link a {
    color: #9CA3AF;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.admin-portal-link a:hover {
    color: var(--text-dark);
}

.admin-portal-link span {
    font-size: 0.75rem;
    font-style: italic;
    color: #D1D5DB;
}

/* Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: absolute;
    top: 2.5rem;
    left: 4rem;
    color: var(--white);
    font-size: 2.25rem;
    font-weight: 600;
    z-index: 10;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-dark);
}

/* Footer Styles */
.compliance-footer {
    border-top: 1px solid #E5E7EB;
    padding: 3rem 0;
    margin-top: 2rem;
    text-align: center;
    background-color: #F8FAFC;
    color: #94A3B8;
    font-size: 0.75rem;
    line-height: 1.6;
}

.footer-copyright {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #64748B;
}

.footer-regulatory {
    max-width: 600px;
    margin: 0 auto;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr !important;
        margin: 20px;
        min-height: auto !important;
        height: auto !important;
    }

    .auth-sidebar {
        padding: 2.5rem 2rem;
        min-height: auto;
        display: block !important;
        width: 100% !important;
    }

    .auth-content {
        padding: 2rem;
        flex: none !important;
    }

    .auth-sidebar::before,
    .auth-sidebar::after {
        display: none;
        /* Hide decorative circles on mobile to save space */
    }

    .auth-content {
        padding: 2rem;
    }

    .brand-logo {
        top: 1.5rem;
        left: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

.theme-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--text-dark);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

body.dark-mode .theme-btn {
    box-shadow: 0 4px 6px -1px rgba(255,255,255,0.05), 0 2px 4px -2px rgba(255,255,255,0.05);
}

.theme-btn:hover {
    transform: scale(1.1);
}

/* IMPORTANT: FORCED MOBILE OVERRIDES AT END OF FILE */
@media (max-width: 1024px) {
    .auth-layout {
        display: block !important;
        padding: 4rem 1rem 1rem 1rem !important;
    }

    .auth-container {
        grid-template-columns: 1fr !important;
        margin: 0 auto !important;
        min-height: auto !important;
        height: auto !important;
        width: 100% !important;
    }

    .auth-sidebar {
        padding: 2.5rem 2rem !important;
        min-height: auto !important;
        width: 100% !important;
    }

    .auth-content {
        padding: 2rem !important;
        width: 100% !important;
    }

    .auth-sidebar::before,
    .auth-sidebar::after {
        display: none !important;
    }

    .brand-logo {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        margin-bottom: 2rem !important;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 480px) {
    .auth-layout {
        padding: 4rem 1rem 1.5rem 1rem !important;
        display: flex !important;
        flex-direction: column !important;
    }

    h1 {
        font-size: 1.5rem !important;
    }
    
    .auth-sidebar {
        padding: 2rem 1.25rem !important;
    }

    .top-nav {
        top: 1rem !important;
        right: 1rem !important;
    }

    .auth-layout .lang-dropdown-wrapper {
        top: 1rem !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) scale(0.9) !important;
        transform-origin: center top !important;
        margin: 0 !important;
        display: flex !important;
        justify-content: center !important;
    }

    .auth-layout .lang-menu {
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .topbar .lang-dropdown-wrapper {
        transform: scale(0.85) !important;
        transform-origin: right center !important;
        margin-right: 0 !important;
    }

    .lang-dropdown-btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.7rem !important;
        gap: 0.35rem !important;
        white-space: nowrap !important;
    }

    .lang-menu {
        width: 250px !important;
        grid-template-columns: 1fr !important;
        padding: 0.75rem !important;
        right: 0 !important;
    }

    .lang-option {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }
}

/* ------------------------------------- */
/* QA AUDITS MODULE STYLES */
/* ------------------------------------- */
.qa-mode-btn {
    opacity: 0.7;
    filter: grayscale(1);
    background: #F9FAFB;
}

.qa-mode-btn:hover {
    opacity: 1;
    filter: grayscale(0);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.qa-mode-btn.active-mode {
    opacity: 1;
    filter: grayscale(0);
    border-color: #3B82F6;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

#mode-fixer.active-mode {
    border-color: #EF4444;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.qa-tag-select-container {
    position: relative;
    width: 100%;
}

.qa-tag-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.qa-tag-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #F3F4F6;
    display: flex;
    flex-direction: column;
}

.qa-tag-option:hover {
    background-color: #EFF6FF;
}

.qa-tag-code {
    font-weight: 700;
    color: #1F2937;
    font-size: 0.875rem;
}

.qa-tag-desc {
    font-size: 0.75rem;
    color: #6B7280;
    margin-top: 0.25rem;
}
/* =========================================================================
   Universal Print Media Styles (Resolves Audit/PDF Pagination Clipping)
   ========================================================================= */
@media print {
    /* Explode the layout from viewport constraints so all overflowing pages render */
    html, body, #main-content, .app-layout, .main-scroll-area {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        position: static !important;
    }
    
    /* Ensure background colors render strictly for badges and highlighted tags */
    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Prevent crucial inputs and headers from snapping across page breaks */
    .form-group, h1, h2, h3, h4 {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Release widget heights but keep their visual borders clean */
    .widget-container {
        page-break-inside: auto;
        break-inside: auto;
        border: 1px solid #E5E7EB !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
    }
}
