/* SANA PROJECT - UNIFIED CSS */

/* GLOBAL DESIGN SYSTEM */

:root {
    /* Brand identity colors */
    --background: 210 40% 98%;
    --foreground: 222 47% 11%;
    --primary: 160 84% 39%;
    --primary-glow: hsla(160, 84%, 39%, 0.2);
    --secondary: 210 100% 52%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --border: 214.3 31.8% 91.4%;
    --card: 0 0% 100%;
    --radius: 1.25rem;
    --gradient: linear-gradient(135deg, #059669 0%, #3b82f6 100%);

    /* Shared theme variables for all pages */
    --primary-gradient: var(--gradient);
    --primary-color: hsl(var(--primary));
    --secondary-color: hsl(var(--secondary));
    --success-color: #10b981;
    --bg-light: hsl(var(--background));
    --card-bg: hsl(var(--card));
    --text-dark: hsl(var(--foreground));
    --text-gray: hsl(var(--muted-foreground));
    --text-muted: hsla(var(--muted-foreground), 0.7);
    --input-border: hsl(var(--border));
    --error-color: #ef4444;
    --tab-bg: hsl(var(--muted));

    /* Typography */
    --font-ar: 'Readex Pro', sans-serif;
    --font-en: 'Inter', sans-serif;
}

[data-theme="dark"] {
    /* Dark mode theme colors */
    --background: 222 47% 4%;
    --foreground: 210 40% 98%;
    --primary: 160 84% 45%;
    --primary-glow: hsla(160, 84%, 45%, 0.15);
    --card: 222 47% 6%;
    --muted: 217 32% 12%;
    --muted-foreground: 215 20.2% 65.1%;
    --border: 217 32% 17%;
    
    /* Dark mode values used across auth and landing pages */
    --card-bg: hsl(var(--card));
    --bg-light: hsl(var(--background));
    --text-dark: hsl(var(--foreground));
    --input-border: hsl(var(--border));
    --tab-bg: hsl(var(--muted));
}

/* Apply the main font to all common UI elements */
body, input, button, select, textarea {
    font-family: var(--font-ar);
}

/* Keyboard accessibility */
:focus-visible {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 3px !important;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
}

/* Placeholder contrast */
::placeholder {
    color: var(--text-gray) !important;
    opacity: 1 !important;
}
/* ACCESSIBILITY FAB */

/* Main container */
.accessibility-container {
    position: fixed;
    bottom: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* English language layout */
html[dir="ltr"] .accessibility-container {
    left: 2rem;
    right: auto;
    align-items: flex-start;
}

/* Arabic language layout */
html[dir="rtl"] .accessibility-container {
    right: 2rem;
    left: auto;
    align-items: flex-end;
}

/* Floating action button */
.access-toggle {
    width: 52px;
    height: 52px;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.28rem;
    cursor: pointer;
    box-shadow: 0 8px 32px hsla(160, 84%, 39%, 0.4), 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.access-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 55%);
    border-radius: 50%;
    pointer-events: none;
}

.access-toggle:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 16px 48px hsla(160, 84%, 39%, 0.45),
                0 4px 16px hsla(210, 100%, 52%, 0.25);
}

.access-toggle:active {
    transform: scale(0.97);
}

/* Accessibility menu panel */
.access-menu {
    position: absolute;
    bottom: 66px;
    width: 292px;
    background: hsl(var(--card) / 0.85);
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 6px);
    padding: 1.5rem;
    box-shadow: 0 32px 64px rgba(0,0,0,0.18),
                0 8px 24px rgba(0,0,0,0.10),
                inset 0 1px 0 rgba(255,255,255,0.12);
    display: none;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Left-to-right layout */
html[dir="ltr"] .access-menu {
    left: 0;
    right: auto;
    direction: ltr;
    text-align: left;
}

/* Right-to-left layout */
html[dir="rtl"] .access-menu {
    right: 0;
    left: auto;
    direction: rtl;
    text-align: right;
}

/* Dark mode menu style */
[data-theme="dark"] .access-menu {
    background: hsl(var(--card) / 0.92);
    border-color: hsl(var(--border));
    box-shadow: 0 32px 64px rgba(0,0,0,0.5),
                inset 0 1px 0 rgba(255,255,255,0.06);
}

.access-menu.active {
    display: block;
    animation: panelReveal 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes panelReveal {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Menu title */
.access-menu h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid hsl(var(--border));
}

/* Accessibility option row */
.access-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    font-size: 0.855rem;
    color: hsl(var(--foreground));
    font-weight: 500;
    flex-wrap: nowrap;
    gap: 8px;
}

/* Increase/decrease button group */
.btn-group {
    display: flex;
    gap: 0.38rem;
    flex-shrink: 0;
}

.btn-group button {
    padding: 0.3rem 0.65rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted));
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: hsl(var(--foreground));
    transition: all 0.18s ease;
    font-family: var(--font-ar);
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-group button:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsla(160, 84%, 39%, 0.35);
}

/* Wide action buttons */
.wide-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted));
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: hsl(var(--foreground));
    transition: all 0.18s ease;
    font-family: var(--font-ar);
    white-space: nowrap;
    height: 32px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.wide-btn:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsla(160, 84%, 39%, 0.35);
}

/* Reset button */
.reset-btn {
    width: 100%;
    margin-top: 0.85rem;
    padding: 0.52rem;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    cursor: pointer;
    color: hsl(var(--muted-foreground));
    font-family: var(--font-ar);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.18s ease;
    text-align: center;
}

.reset-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Additional dark mode adjustments */
[data-theme="dark"] .access-menu h3 {
    color: hsl(var(--muted-foreground));
}

[data-theme="dark"] .access-item {
    color: hsl(var(--foreground));
}

[data-theme="dark"] .wide-btn,
[data-theme="dark"] .btn-group button {
    background: hsl(var(--muted));
    color: hsl(var(--foreground));
    border-color: hsl(var(--border));
}

[data-theme="dark"] .wide-btn:hover,
[data-theme="dark"] .btn-group button:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

[data-theme="dark"] .reset-btn {
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border-color: hsl(var(--border));
}

[data-theme="dark"] .reset-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* LTR direction fix */
html[dir="ltr"] .accessibility-container {
    right: 2rem !important;
    left: auto !important;
}

html[dir="ltr"] .access-menu {
    right: 0 !important;
    left: auto !important;
    direction: ltr !important;
    text-align: left !important;
}

/* High contrast variables */
body.high-contrast {
    --hc-bg: #000000;
    --hc-surface: #121212;
    --hc-text-primary: #FFFFFF;
    --hc-text-secondary: #56B4E9;
    --hc-accent: #E69F00;
    --hc-link: #F0E442;
    --hc-success: #009E73;
    --hc-danger: #D55E00;
    --hc-border: #FFFFFF;
}

body.high-contrast {
    background-color: var(--hc-bg) !important;
    color: var(--hc-text-primary) !important;
}

/* Containers: layered contrast approach */
/* WCAG High Contrast Mode */
body.high-contrast {
    --hc-bg: #000000;
    --hc-text-primary: #FFFFFF;
    --hc-text-secondary: #56B4E9;
    --hc-accent: #E69F00;
    --hc-link: #F0E442;
    --hc-border: #FFFFFF;
}

body.high-contrast {
    background-color: var(--hc-bg) !important;
    color: var(--hc-text-primary) !important;
    background-image: none !important;
}

/* HC main containers */
body.high-contrast header, 
body.high-contrast footer,
body.high-contrast main,
body.high-contrast section,
body.high-contrast .card,
body.high-contrast .main-card,
body.high-contrast .feature-card,
body.high-contrast .testimonial-card,
body.high-contrast .login-section,
body.high-contrast .brand-section,
body.high-contrast .access-menu {
    background-color: var(--hc-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Add clear white borders to define card areas */
body.high-contrast .card,
body.high-contrast .main-card,
body.high-contrast .feature-card,
body.high-contrast .testimonial-card,
body.high-contrast .access-menu {
    border: 2px solid var(--hc-border) !important;
}

/* Text and gradients: remove gradients to ensure contrast */
body.high-contrast h1, 
body.high-contrast h2, 
body.high-contrast h3, 
body.high-contrast p, 
body.high-contrast span,
body.high-contrast label {
    color: var(--hc-text-primary) !important;
    text-shadow: none !important;
}

body.high-contrast .gradient-text,
body.high-contrast .logo span,
body.high-contrast .footer-logo strong {
    background: none !important;
    -webkit-text-fill-color: var(--hc-link) !important;
    color: var(--hc-link) !important;
}

body.high-contrast .text-muted,
body.high-contrast p.section-desc {
    color: var(--hc-text-secondary) !important;
}

/* Main and interactive buttons */
body.high-contrast button,
body.high-contrast .btn,
body.high-contrast .submit-btn,
body.high-contrast .btn-submit,
body.high-contrast .access-toggle {
    background-color: var(--hc-accent) !important;
    background-image: none !important;
    color: #000000 !important;
    border: 3px solid var(--hc-text-primary) !important;
    font-weight: 900 !important;
}

/* Inputs and forms: remove incorrect wrapper backgrounds */
body.high-contrast input, 
body.high-contrast select,
body.high-contrast .field-wrapper input,
body.high-contrast .field input {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-text-primary) !important;
    color: var(--hc-text-primary) !important;
}

body.high-contrast input::placeholder {
    color: var(--hc-text-secondary) !important;
    opacity: 1 !important;
}

/* Icons and links */
body.high-contrast i.main-icon,
body.high-contrast .toggle-eye,
body.high-contrast .icon-box {
    background: none !important;
    color: var(--hc-text-primary) !important;
}

/* Brand icons */
body.high-contrast .fa-bolt,
body.high-contrast i.fa-bolt {
    color: var(--hc-link) !important;
    -webkit-text-fill-color: var(--hc-link) !important;
}
body.high-contrast .fa-droplet,
body.high-contrast i.fa-droplet {
    color: var(--hc-text-secondary) !important;
    -webkit-text-fill-color: var(--hc-text-secondary) !important;
}

body.high-contrast a {
    color: var(--hc-link) !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
}

/* Fix dashboard containers in high contrast mode */
body.high-contrast .floating-badge,
body.high-contrast .stat-card,
body.high-contrast .alert-box,
body.high-contrast .chart-container {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
}

/* Ensure faded dashboard colors are removed */
body.high-contrast .primary-text,
body.high-contrast .secondary-text,
body.high-contrast .alert-box {
    color: var(--hc-text-primary) !important;
}

/* Tabs and role switcher */
body.high-contrast .tabs,
body.high-contrast .role-switcher {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
}

body.high-contrast .tab.active,
body.high-contrast .role-switcher button.active {
    background-color: var(--hc-text-primary) !important;
    color: #000000 !important;
}

/* Text: ensure maximum readability */
body.high-contrast h1, 
body.high-contrast h2, 
body.high-contrast h3, 
body.high-contrast h4,
body.high-contrast strong,
body.high-contrast label {
    color: var(--hc-text-primary) !important;
    text-shadow: none !important;
    letter-spacing: 0.5px;
}

/* Make tab buttons white in high contrast mode */
body.high-contrast .tab {
    color: var(--hc-text-primary) !important;
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-text-primary) !important;
}

/* Employee type buttons - High Contrast */

body.high-contrast .emp-type-option {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

/* Selected state: dark yellow */
body.high-contrast .emp-type-option:has(input[type="radio"]:checked) {
    background-color: #D4AF00 !important;
    border: 3px solid #FFFFFF !important;
}

/* When selected, make all inner content black */
body.high-contrast .emp-type-option:has(input[type="radio"]:checked),
body.high-contrast .emp-type-option:has(input[type="radio"]:checked) span,
body.high-contrast .emp-type-option:has(input[type="radio"]:checked) i {
    color: #000000 !important;
}

/* Make the second selected option blue */
body.high-contrast .emp-type-option:nth-child(2):has(input[type="radio"]:checked) {
    background-color: #0077CC !important;
}

body.high-contrast p, 
body.high-contrast span, 
body.high-contrast li {
    color: var(--hc-text-primary) !important;
}

body.high-contrast small,
body.high-contrast .text-muted {
    color: var(--hc-text-secondary) !important;
}

/* Links: dual visual distinction using color and underline */
body.high-contrast a {
    color: var(--hc-link) !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    font-weight: bold !important;
}

body.high-contrast a:hover {
    background: none !important;
    background-color: transparent !important;
    color: var(--hc-accent) !important;
    -webkit-text-fill-color: var(--hc-accent) !important;
}

/* Buttons: clear solid high-contrast style */
body.high-contrast button,
body.high-contrast .btn,
body.high-contrast [role="button"] {
    background-color: var(--hc-accent) !important;
    color: #000000 !important;
    border: 3px solid var(--hc-text-primary) !important;
    border-radius: 4px !important;
    font-weight: 900 !important;
    cursor: pointer;
}

body.high-contrast button:hover,
body.high-contrast .btn:hover {
    outline: 2px solid var(--hc-link) !important;
    outline-offset: 2px;
}

body.high-contrast button:focus {
    outline: 4px solid var(--hc-link) !important;
}

/* Inputs: comfortable high-contrast styling */
body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select {
    background-color: #000 !important;
    border: 2px solid var(--hc-text-primary) !important;
    color: var(--hc-text-primary) !important;
    border-radius: 0 !important;
}

body.high-contrast input::placeholder {
    color: var(--hc-text-secondary) !important;
    opacity: 1;
}

/* Hide decorative canvas in HC */
body.high-contrast #bg-canvas { display: none !important; }

/* Alerts and functional colors */
body.high-contrast .text-success, 
body.high-contrast .alert-success { 
    color: var(--hc-success) !important; 
    border-left: 8px solid var(--hc-success) !important; 
}

body.high-contrast .text-danger, 
body.high-contrast .alert-danger { 
    color: var(--hc-danger) !important; 
    border-left: 8px solid var(--hc-danger) !important; 
}

/* Images and media: reduce visual distraction */
body.high-contrast img {
    filter: none !important;
    border: 2px solid #F0E442 !important;
    border-radius: 8px;
}

body.high-contrast .logo {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

body.high-contrast .logo-img-wrapper {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

body.high-contrast .logo:hover {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

body.high-contrast .logo:hover .logo-img-wrapper {
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
}

body.high-contrast .nav-links a::after {
    display: none !important;
}

body.high-contrast .badge {
    background: none !important;
    color: #56B4E9 !important;
    border: 2px solid #56B4E9 !important;
    border-radius: 50px !important;
}

body.high-contrast .user-avatar {
    background: #EF9F27 !important;
    color: #000000 !important;
    border-color: #FAC775 !important;
}

body.high-contrast .quote-icon {
    background: #EF9F27 !important;
    color: #000000 !important;
}

body.high-contrast .testimonial-card:hover .quote-icon {
    background: #F0E442 !important;
    color: #000000 !important;
}

body.high-contrast .testi-card-bottom {
    border-top-color: #EF9F27 !important;
}

body.high-contrast .section-desc {
    color: #FFFFFF !important;
}

body.high-contrast .stats-bar {
    background: #000000 !important;
    border-top: 2px solid #FFFFFF !important;
    border-bottom: 2px solid #FFFFFF !important;
}

body.high-contrast .stat-item strong,
body.high-contrast .stat-item span,
body.high-contrast .counter-num,
body.high-contrast .counter-sign {
    color: #FFFFFF !important;
}

body.high-contrast .stat-item i {
    color: #FFFFFF !important;
}

body.high-contrast #how-desc {
    color: #FFFFFF !important;
}

body.high-contrast .trust-badge svg {
    color: #56B4E9 !important;
    stroke: #56B4E9 !important;
}

body.high-contrast .line-decorator {
    background: #56B4E9 !important;
}

body.high-contrast .floating-badge svg {
    color: #56B4E9 !important;
    stroke: #56B4E9 !important;
}

body.high-contrast .icon-box {
    background: #000000 !important;
    border: 2px solid #EF9F27 !important;
}

body.high-contrast .icon-box svg {
    color: #EF9F27 !important;
    stroke: #EF9F27 !important;
}

body.high-contrast .feature-card:hover .icon-box {
    background: #EF9F27 !important;
}

body.high-contrast .feature-card:hover .icon-box svg {
    color: #000000 !important;
    stroke: #000000 !important;
}

/* Hide decorative elements that do not support content */
body.high-contrast .decorative-shapes,
body.high-contrast .bg-glow {
    display: none !important;
}

body.high-contrast .error-text,
body.high-contrast .validation-msg,
body.high-contrast small.error-text {
    color: #F0E442 !important;
}

body.high-contrast #empPasswordRequirements {
    background-color: #000000 !important;
    border: 2px solid #FFFFFF !important;
    border-radius: 12px !important;
    padding: 12px !important;
}

/* High Contrast - Password Requirements Box */
body.high-contrast #passwordRequirements {
    background-color: #000000 !important;
    border: 2px solid #FFFFFF !important;
    border-radius: 12px !important;
    padding: 12px !important;
}

/* Scrollbar - Primary Color */
body.signup-page .card::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

/* Scrollbar - High Contrast */
body.high-contrast.signup-page .card::-webkit-scrollbar-thumb {
    background: #56B4E9 !important;
}

body.high-contrast .back-landing:hover,
body.high-contrast .back-nav:hover {
    background-color: transparent !important;
    color: #000000 !important;
}

/* Password Requirements - High Contrast */

body.high-contrast #passwordRequirements,
body.high-contrast #reqResetBox {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
    padding: 12px;
    border-radius: 8px;
}

/* Main text for password requirements */
body.high-contrast #passwordRequirements .req-item,
body.high-contrast #reqReset .req-item {
    color: var(--hc-text-secondary) !important;
    font-weight: 600;
}

/* Requirement icons */
body.high-contrast #passwordRequirements .req-item i,
body.high-contrast #reqReset .req-item i {
    color: var(--hc-text-secondary) !important;
}

/* When the requirement is met */
body.high-contrast #passwordRequirements .req-item.valid,
body.high-contrast #reqReset .req-item.valid {
    color: var(--hc-success) !important;
}

/* Icon for met requirement */
body.high-contrast #passwordRequirements .req-item.valid i,
body.high-contrast #reqReset .req-item.valid i {
    color: var(--hc-success) !important;
}

/* Unmet requirement */
body.high-contrast #passwordRequirements .req-item.invalid,
body.high-contrast #reqReset .req-item.invalid {
    color: var(--hc-danger) !important;
}

body.high-contrast #passwordRequirements .req-item.invalid i,
body.high-contrast #reqReset .req-item.invalid i {
    color: var(--hc-danger) !important;
}

/* Password reset requirements box */
body.high-contrast #reqResetBox {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
    padding: 12px;
    border-radius: 8px;
}

body.high-contrast #reqReset {
    background-color: var(--hc-bg) !important;
}

body.high-contrast #reqReset .req-item {
    color: var(--hc-text-secondary) !important;
}

/* High Contrast - Social Links */
body.high-contrast .social-links a {
    background-color: #000000 !important;
    color: var(--hc-link) !important;
    border: 2px solid var(--hc-border) !important;
    padding: 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    transition: all 0.2s ease;
}

body.high-contrast .social-links a:hover {
    background-color: #001F3F !important;
    color: var(--hc-link) !important;
}

/* App logo inside social links */
body.high-contrast .social-links .app-logo {
    color: var(--hc-link) !important;
}

/* Validation messages in high contrast mode */
body.high-contrast .validation-msg {
    color: var(--hc-text-secondary) !important;
    font-weight: 700;
}

/* Language and theme buttons - High Contrast */
body.high-contrast .controls .theme-toggle,
body.high-contrast .controls .lang-toggle {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: 3px solid #FFFFFF !important;
    border-radius: 4px !important;
}

body.high-contrast .controls .theme-toggle:hover,
body.high-contrast .controls .lang-toggle:hover {
    background: #E69F00 !important;
    background-image: none !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
    box-shadow: none !important;
    transform: none !important;
}
/* WCAG High Contrast Mode */

/* High contrast variables */
body.high-contrast {
    --hc-bg: #000000;
    --hc-surface: #121212;
    --hc-text-primary: #FFFFFF;
    --hc-text-secondary: #56B4E9;
    --hc-accent: #E69F00;
    --hc-link: #F0E442;
    --hc-success: #009E73;
    --hc-danger: #D55E00;
    --hc-border: #FFFFFF;
}

/* Global background */
body.high-contrast {
    background-color: var(--hc-bg) !important;
    color: var(--hc-text-primary) !important;
    background-image: none !important;
}

/* Main containers and cards */
body.high-contrast header,
body.high-contrast footer,
body.high-contrast main,
body.high-contrast section,
body.high-contrast .card,
body.high-contrast .main-card,
body.high-contrast .feature-card,
body.high-contrast .testimonial-card,
body.high-contrast .login-section,
body.high-contrast .brand-section,
body.high-contrast .access-menu {
    background-color: var(--hc-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
}

/* Clear white borders for cards */
body.high-contrast .card,
body.high-contrast .main-card,
body.high-contrast .feature-card,
body.high-contrast .testimonial-card,
body.high-contrast .access-menu {
    border: 2px solid var(--hc-border) !important;
}

/* Text and gradients */
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast strong,
body.high-contrast label {
    color: var(--hc-text-primary) !important;
    text-shadow: none !important;
    letter-spacing: 0.5px;
}

body.high-contrast p,
body.high-contrast span,
body.high-contrast li {
    color: var(--hc-text-primary) !important;
}

body.high-contrast small,
body.high-contrast .text-muted {
    color: var(--hc-text-primary) !important;
}

body.high-contrast .gradient-text,
body.high-contrast .logo span,
body.high-contrast .footer-logo strong {
    background: none !important;
    -webkit-text-fill-color: var(--hc-link) !important;
    color: var(--hc-link) !important;
}

body.high-contrast .text-muted,
body.high-contrast p.section-desc {
    color: var(--hc-text-secondary) !important;
}

/* Links */
body.high-contrast a {
    color: var(--hc-link) !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    font-weight: bold !important;
}

body.high-contrast .social-links a:hover {
    background: #EF9F27 !important;
    background-image: none !important;
    border-color: #EF9F27 !important;
    box-shadow: none !important;
}

body.high-contrast .social-links a:hover i,
body.high-contrast .social-links a:hover svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* Buttons */
body.high-contrast button,
body.high-contrast .btn,
body.high-contrast [role="button"],
body.high-contrast .submit-btn,
body.high-contrast .btn-submit,
body.high-contrast .access-toggle {
    background-color: var(--hc-accent) !important;
    background-image: none !important;
    color: #000000 !important;
    border: 3px solid var(--hc-text-primary) !important;
    font-weight: 900 !important;
    border-radius: 4px !important;
    cursor: pointer;
}

body.high-contrast button:focus {
    outline: 4px solid var(--hc-link) !important;
}

/* Input fields */
body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select,
body.high-contrast .field-wrapper input,
body.high-contrast .field input {
    background-color: #000 !important;
    border: 2px solid var(--hc-text-secondary) !important;
    color: var(--hc-text-primary) !important;
    border-radius: 0 !important;
}

body.high-contrast input::placeholder {
    color: #ccc !important;
    opacity: 1 !important;
}

/* Images */
body.high-contrast img {
    filter: grayscale(100%) contrast(120%);
    border: 1px solid var(--hc-border);
}

/* Decorative elements */
body.high-contrast .decorative-shapes,
body.high-contrast .bg-glow {
    display: none !important;
}

/* Alerts and functional colors */
body.high-contrast .text-success,
body.high-contrast .alert-success {
    color: var(--hc-success) !important;
    border-left: 8px solid var(--hc-success) !important;
}

body.high-contrast .text-danger,
body.high-contrast .alert-danger {
    color: var(--hc-danger) !important;
    border-left: 8px solid var(--hc-danger) !important;
}

/* Fix border direction in LTR */
html[dir="ltr"] body.high-contrast .alert-success,
html[dir="ltr"] body.high-contrast .alert-danger {
    border-left: none !important;
    border-right: 8px solid var(--hc-success) !important;
}

/* Dashboard */

/* Dashboard containers */
body.high-contrast .floating-badge,
body.high-contrast .stat-card,
body.high-contrast .alert-box,
body.high-contrast .chart-container {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
}

/* Dashboard text */
body.high-contrast .primary-text,
body.high-contrast .secondary-text,
body.high-contrast .alert-box {
    color: var(--hc-text-primary) !important;
}

/* Bars */
body.high-contrast .bar {
    opacity: 1 !important;
    outline: 1px solid #FFFFFF !important;
}

body.high-contrast .bar-1,
body.high-contrast .bar-4 {
    background: #FAC775 !important;
}

body.high-contrast .bar-2 {
    background: #EF9F27 !important;
}

body.high-contrast .bar-3,
body.high-contrast .bar-6 {
    background: #BA7517 !important;
}

body.high-contrast .bar-5.highlight {
    background: #F0E442 !important;
    outline: 2px solid #FFFFFF !important;
}

/* Chart container background */
body.high-contrast .chart-container {
    background-color: #111 !important;
    border: 2px solid var(--hc-border) !important;
}

/* Dashboard stat cards */
body.high-contrast .stat-card {
    background-color: #0a0a0a !important;
    border: 2px solid #FAC775 !important;
}

body.high-contrast .stat-card .val {
    color: #F0E442 !important;
}

body.high-contrast .stat-card .stat-sub {
    color: #FAC775 !important;
}

body.high-contrast .stat-card .stat-label {
    color: #FAC775 !important;
}

/* Alert box */
body.high-contrast .alert-box {
    background: rgba(240, 228, 66, 0.08) !important;
    color: #F0E442 !important;
    border: 2px solid #F0E442 !important;
}

/* Four "How It Works" cards */
body.high-contrast .step-icon-wrapper,
body.high-contrast .grad-1,
body.high-contrast .grad-2,
body.high-contrast .grad-3,
body.high-contrast .grad-4 {
    background-image: none !important;
    border: 3px solid #FFFFFF!important;
    box-shadow: 0 0 12px rgba(240, 228, 66, 0.4) !important;
}

body.high-contrast .grad-1 {
    background-color: #EF9F27 !important;
}

body.high-contrast .grad-2 {
    background-color: #EF9F27 !important;
}

body.high-contrast .grad-3 {
    background-color: #EF9F27 !important;
}

body.high-contrast .grad-4 {
    background-color: #EF9F27 !important;
}

body.high-contrast .step-icon-wrapper i {
    color: #000000 !important;
}

body.high-contrast .step-number {
    background: #F0E442 !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
}

body.high-contrast .step-title {
    color: #F0E442 !important;
}

body.high-contrast .step-desc {
    color: var(--hc-text-primary) !important;
}

/* Tabs and role switcher */
body.high-contrast .tabs,
body.high-contrast .role-switcher {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
}

body.high-contrast .tab {
    color: var(--hc-text-primary) !important;
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-text-primary) !important;
}

body.high-contrast .tab.active,
body.high-contrast .role-switcher button.active {
    background-color: var(--hc-text-primary) !important;
    color: #000000 !important;
    outline: 4px solid var(--hc-link) !important;
}

/* Active button text and icon */
body.high-contrast .role-switcher button.active span,
body.high-contrast .role-switcher button.active i {
    color: #000000 !important;
}

/* Default button */
body.high-contrast .role-switcher button {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

/* Employee type buttons */
body.high-contrast .emp-type-option {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

body.high-contrast .emp-type-option:has(input[type="radio"]:checked) {
    background-color: #D4AF00 !important;
    border: 3px solid #FFFFFF !important;
}

body.high-contrast .emp-type-option:has(input[type="radio"]:checked),
body.high-contrast .emp-type-option:has(input[type="radio"]:checked) span,
body.high-contrast .emp-type-option:has(input[type="radio"]:checked) i {
    color: #000000 !important;
}

body.high-contrast .emp-type-option:nth-child(2):has(input[type="radio"]:checked) {
    background-color: #0077CC !important;
}

/* Password requirements */
body.high-contrast #passwordRequirements,
body.high-contrast #reqResetBox {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
    padding: 12px;
    border-radius: 8px;
}

body.high-contrast #passwordRequirements .req-item,
body.high-contrast #reqReset .req-item {
    color: var(--hc-text-secondary) !important;
    font-weight: 600;
}

body.high-contrast #passwordRequirements .req-item i,
body.high-contrast #reqReset .req-item i {
    color: var(--hc-text-secondary) !important;
}

body.high-contrast #passwordRequirements .req-item.valid,
body.high-contrast #reqReset .req-item.valid {
    color: var(--hc-success) !important;
}

body.high-contrast #passwordRequirements .req-item.valid i,
body.high-contrast #reqReset .req-item.valid i {
    color: var(--hc-success) !important;
}

body.high-contrast #passwordRequirements .req-item.invalid,
body.high-contrast #reqReset .req-item.invalid {
    color: var(--hc-danger) !important;
}

body.high-contrast #passwordRequirements .req-item.invalid i,
body.high-contrast #reqReset .req-item.invalid i {
    color: var(--hc-danger) !important;
}

body.high-contrast #reqResetBox {
    background-color: var(--hc-bg) !important;
    border: 2px solid var(--hc-border) !important;
    padding: 12px;
    border-radius: 8px;
}

body.high-contrast #reqReset {
    background-color: var(--hc-bg) !important;
}

body.high-contrast #reqReset .req-item {
    color: var(--hc-text-secondary) !important;
}

/* Icons */
body.high-contrast i.main-icon,
body.high-contrast .toggle-eye,
body.high-contrast .icon-box {
    background: none !important;
    color: var(--hc-text-primary) !important;
}

/* Language and dark mode buttons */
body.high-contrast .controls .theme-toggle,
body.high-contrast .controls .lang-toggle {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: 3px solid #FFFFFF !important;
    border-radius: 4px !important;
}

body.high-contrast .controls .theme-toggle:hover,
body.high-contrast .controls .lang-toggle:hover {
    background: #E69F00 !important;
    background-image: none !important;
    color: #000000 !important;
    border-color: #FFFFFF !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Social links */
body.high-contrast .social-links a {
    background-color: #001F3F !important;
    color: var(--hc-link) !important;
    border: 2px solid var(--hc-border) !important;
    padding: 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    transition: all 0.2s ease;
}

body.high-contrast .social-links a:hover {
    background-color: #001F3F !important;
    color: var(--hc-link) !important;
}

body.high-contrast .social-links .app-logo {
    color: var(--hc-link) !important;
}

/* Validation messages */
body.high-contrast .validation-msg {
    color: var(--hc-text-secondary) !important;
    font-weight: 700;
}

/* Radio labels */
body.high-contrast .radio-label input:checked + .radio-content {
    background-color: #ffffff !important;
    color: #000000 !important;
}

body.wide-page .container, 
body.wide-page .footer-container, 
body.wide-page main,
body.wide-page section {
    max-width: 98% !important;
    width: 98% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* If Grid or Flexbox is used, allow it to expand */
body.wide-page .row, 
body.wide-page .grid-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Adjust element sizes to fill the new available space */
body.wide-page .card, 
body.wide-page .content-box {
    flex: 1 1 300px;
}

/* Expand signup page */
body.wide-page .card {
    max-width: 90% !important;
    width: 500px !important;
    transition: all 0.3s ease;
}

/* Make the grid take more space and distribute fields better */
body.wide-page .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
}

/* Ensure full-width fields remain full width */
body.wide-page .input-group.full {
    grid-column: span 2 !important;
}

/* Target buttons and menus in wide-page mode */
body.wide-page .btn-submit {
    width: 30% !important;
    margin: 20px auto !important;
    display: block !important;
}

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

/* Added code to support English language */

/* LTR page layout */

/* Move the container to the left immediately */
html[dir="ltr"] .accessibility-container {
    right: auto !important;
    left: 20px !important;
}

/* Adjust menu direction and position */
html[dir="ltr"] .access-menu {
    right: auto !important;
    left: 0 !important;
    direction: ltr !important;
    text-align: left !important;
}

/* Fix borders in high contrast mode for English */
html[dir="ltr"] body.high-contrast .alert-success, 
html[dir="ltr"] body.high-contrast .alert-danger {
    border-left: none !important;
    border-right: 8px solid var(--hc-success) !important;
}

/* SANA PROJECT - UNIFIED DESIGN SYSTEM */

/* Adjust dark mode to work consistently across all pages */
[data-theme="dark"] {
    --background: 222 47% 4%;
    --foreground: 210 40% 98%;
    --primary: 160 84% 45%;
    --primary-glow: hsla(160, 84%, 45%, 0.15);
    --card: 222 47% 6%;
    --muted: 217 32% 12%;
    --muted-foreground: 215 20.2% 65.1%;
    --border: 217 32% 17%;
    
    /* Dark mode auth variables */
    --card-bg: hsl(var(--card));
    --bg-light: hsl(var(--background));
    --text-dark: hsl(var(--foreground));
    --input-border: hsl(var(--border));
    --tab-bg: hsl(var(--muted));
    --shadow-sm: 0 10px 20px rgba(0,0,0,0.2);
    --shadow-md: 0 20px 40px rgba(0,0,0,0.3);
}

/* SANA PROJECT - UNIFIED CSS */

/* Full color consistency across all pages */

/* SANA PROJECT - UNIFIED DESIGN SYSTEM */

:root {
    /* Core brand colors */
    --background: 210 40% 98%;
    --foreground: 222 47% 11%;
    --primary: 160 84% 39%;
    --primary-glow: hsla(160, 84%, 39%, 0.2);
    --secondary: 210 100% 52%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --border: 214.3 31.8% 91.4%;
    --card: 0 0% 100%;
    --radius: 1.25rem;
    --gradient: linear-gradient(135deg, #059669 0%, #3b82f6 100%);

    /* Connect auth page colors to the unified brand identity */
    --primary-gradient: var(--gradient);
    --primary-color: hsl(var(--primary));
    --secondary-color: hsl(var(--secondary));
    --success-color: #10b981;
    --bg-light: hsl(var(--background));
    --card-bg: hsl(var(--card));
    --text-dark: hsl(var(--foreground));
    --text-gray: hsl(var(--muted-foreground));
    --text-muted: hsla(var(--muted-foreground), 0.7);
    --input-border: hsl(var(--border));
    --error-color: #ef4444;
    --tab-bg: hsl(var(--muted));

    /* Unified typography */
    --font-ar: 'Readex Pro', sans-serif;
    --font-en: 'Inter', sans-serif;
}

[data-theme="dark"] {
    /* Unified dark mode for the whole website */
    --background: 222 47% 4%;
    --foreground: 210 40% 98%;
    --primary: 160 84% 45%;
    --primary-glow: hsla(160, 84%, 45%, 0.15);
    --card: 222 47% 6%;
    --muted: 217 32% 12%;
    --muted-foreground: 215 20.2% 65.1%;
    --border: 217 32% 17%;
    
    /* Update auth page variables to match dark mode automatically */
    --card-bg: hsl(var(--card));
    --bg-light: hsl(var(--background));
    --text-dark: hsl(var(--foreground));
    --input-border: hsl(var(--border));
    --tab-bg: hsl(var(--muted));
}

/* Apply the unified font to all project elements */
body, input, button, select, textarea {
    font-family: var(--font-ar);
}

/* Accessibility additions */

/* Keyboard accessibility */
:focus-visible {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 3px !important;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
}

/* Placeholder contrast */
::placeholder {
    color: var(--text-gray) !important;
    opacity: 1 !important;
}


/* SANA PROJECT - UNIFIED DESIGN SYSTEM */

/* Dark mode consistency */
[data-theme="dark"] {
    --background: 222 47% 4%;
    --foreground: 210 40% 98%;
    --primary: 160 84% 45%;
    --primary-glow: hsla(160, 84%, 45%, 0.15);
    --card: 222 47% 6%;
    --muted: 217 32% 12%;
    --muted-foreground: 215 20.2% 65.1%;
    --border: 217 32% 17%;
    
    /* Dark mode auth variables */
    --card-bg: hsl(var(--card));
    --bg-light: hsl(var(--background));
    --text-dark: hsl(var(--foreground));
    --input-border: hsl(var(--border));
    --tab-bg: hsl(var(--muted));
    --shadow-sm: 0 10px 20px rgba(0,0,0,0.2);
    --shadow-md: 0 20px 40px rgba(0,0,0,0.3);
}

/* Employee type selection buttons */
.emp-type-selector {
    display: flex; 
    display: -webkit-flex;
    gap: 10px; margin-bottom: 15px;
}
.emp-type-option {
    flex: 1; 
    -webkit-flex: 1;
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center; 
    -webkit-justify-content: center;
    gap: 8px;
    padding: 12px 10px; border: 2px solid var(--input-border); 
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
    cursor: pointer; 
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    transition: all 0.3s ease; 
    color: var(--text-gray); font-weight: 600;
    font-size: 0.9rem; background: var(--card-bg);
}
.emp-type-option i { font-size: 1.1rem; }
.emp-type-option input { display: none; }
.emp-type-option:has(input:checked) {
    border-color: var(--primary-color); 
    background: var(--primary-glow); 
    color: var(--primary-color);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    -webkit-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    -moz-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
}


/* GLOBAL BODY STYLES */
body {
    font-family: 'Readex Pro', 'Inter', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-transition: background 0.4s ease;
    -moz-transition: background 0.4s ease;
    transition: background 0.4s ease;
}

/* Auth Pages Body Overrides */
body.login-page, body.signup-page {
    background-color: var(--bg-light);
    height: 100vh;
    display: flex;
    display: -webkit-flex;
    font-family: var(--font-ar);
    color: var(--text-dark);
    line-height: normal;
}
html[lang="en"] body.login-page, html[lang="en"] body.signup-page { font-family: var(--font-en); }
body.login-page { overflow: hidden; }
body.signup-page { 
    justify-content: center; 
    -webkit-justify-content: center;
    align-items: center; 
    -webkit-align-items: center;
}


/* LANDING PAGE STYLES */
#bg-canvas { position: fixed; top: 0; left: 0; z-index: -1; opacity: 0.9; }

header {
    display: flex; 
    display: -webkit-flex;
    justify-content: space-between; 
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    padding: 1rem 6%; background: hsla(var(--background), 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px); border-bottom: 1px solid hsl(var(--border));
    position: fixed; top: 0; width: 100%; z-index: 1000;
}

.logo { 
    font-size: 1.7rem; 
    font-weight: 800; 
    color: hsl(var(--foreground));

    display: flex; 
    align-items: center; 

    gap: 14px; 
    text-decoration: none;

    padding: 10px 20px; 
    border-radius: 14px;

    background: hsla(var(--primary), 0.05); 
    border: 1px solid hsla(var(--primary), 0.1);

    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px hsla(var(--primary), 0.15);
}

/* Logo box */
.logo-img-wrapper {
    width: 58px;
    height: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border-radius: 16px;
    padding: 0;
    position: relative;
    overflow: visible;

    transition: all 0.35s ease;
}

/* Gradient border */
.logo-img-wrapper::before {
    content: "";
    position: absolute;
    inset: -2.5px;
    border-radius: 18px;
    background: var(--gradient);
    z-index: 0;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2.5px;
    transition: opacity 0.35s ease;
}

.logo:hover .logo-img-wrapper::before {
    left: 100%;
    opacity: 1;
}

/* Enlarge on hover */
.logo:hover .logo-img-wrapper {
    transform: scale(1.08) rotate(2deg);
}

/* Image */
.logo-img-wrapper img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 14px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.logo:hover .logo-img-wrapper img {
    transform: scale(1.1);
}

/* Text */
.logo span { 
    background: var(--gradient); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 

    transition: letter-spacing 0.3s ease;
}

.logo:hover span {
    letter-spacing: 1px;
}

/* Navigation links */
.nav-links {
    display: flex;
    display: -webkit-flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-links a {
    position: relative;
    text-decoration: none;
    color: hsl(var(--foreground));
    font-weight: 500;
    font-size: 1rem;
    padding: 6px 4px;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    transition: all 0.3s ease;
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: var(--gradient);
    -webkit-transition: width 0.3s ease;
    -moz-transition: width 0.3s ease;
    transition: width 0.3s ease;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
}
.nav-links a:hover::after {
    width: 100%;
}
.back-nav {
    display: inline-flex;
    display: -webkit-inline-flex;
    align-items: center;
    -webkit-align-items: center;
    gap: 8px;
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Arabic layout: arrow before text, aligned to the left */
html[dir="rtl"] .back-nav {
    justify-content: flex-start;
    -webkit-justify-content: flex-start;
    flex-direction: row-reverse;
    -webkit-flex-direction: row-reverse;
}

/* Back link LTR layout */
html[dir="ltr"] .back-nav {
    justify-content: flex-end;
    -webkit-justify-content: flex-end;
    flex-direction: row;
    -webkit-flex-direction: row;
}

/* Flip arrow in English */
html[dir="ltr"] .back-icon {
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    transform: rotate(180deg);
}

/* Keep arrow normal in Arabic */
html[dir="rtl"] .back-icon {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    transform: rotate(0deg);
}

.back-icon {
    font-size: 16px;
}

/* Landing page specific controls */
body:not(.login-page):not(.signup-page) .controls { 
    display: flex; 
    display: -webkit-flex;
    gap: 1rem; align-items: center; 
    -webkit-align-items: center;
}

.login-link { text-decoration: none; color: hsl(var(--foreground)); font-size: 0.9rem; font-weight: 500; }

.btn {
    padding: 0.6rem 1.4rem; 
    -webkit-border-radius: var(--radius);
    -moz-border-radius: var(--radius);
    border-radius: var(--radius); 
    font-weight: 600;
    cursor: pointer; border: none; 
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    transition: all 0.3s ease; 
    font-size: 0.9rem;
    display: inline-flex; 
    display: -webkit-inline-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center; 
    -webkit-justify-content: center;
    gap: 8px;
}
.btn-primary { 
    background: var(--gradient); color: white; 
    -webkit-box-shadow: 0 4px 15px var(--primary-glow);
    -moz-box-shadow: 0 4px 15px var(--primary-glow);
    box-shadow: 0 4px 15px var(--primary-glow); 
}
.btn-secondary {
    padding: 1.1rem 2.5rem; font-size: 1rem; 
    background: linear-gradient(hsl(var(--background)), hsl(var(--background))) padding-box, var(--gradient) border-box; 
    color: hsl(var(--foreground)); border: 2px solid transparent;
}

.theme-toggle, .lang-toggle {
    background: hsl(var(--card)); border: 1px solid hsl(var(--border));
    width: 40px; height: 40px; 
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    cursor: pointer; color: hsl(var(--foreground)); font-weight: bold; font-size: 0.8rem;
}

.hero {
    display: grid; grid-template-columns: 1.2fr 0.8fr;
    padding: 10rem 8% 5rem; align-items: center; gap: 4rem;
    max-width: 1400px; margin: 0 auto;
}
.hero-subtitle-container { 
    color: hsl(var(--primary)); font-weight: 600; margin-bottom: 1rem; 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 8px; 
}
.line-decorator { width: 24px; height: 2px; background: hsl(var(--primary)); }
.hero-content h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 1.5rem; font-weight: 800; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-content p { color: hsl(var(--muted-foreground)); font-size: 1.15rem; margin-bottom: 2.5rem; max-width: 550px; }
.hero-btns { 
    display: flex; 
    display: -webkit-flex;
    gap: 1rem; flex-wrap: wrap; 
    -webkit-flex-wrap: wrap;
}
.main-cta-btn { padding: 1.1rem 2.5rem; font-size: 1rem; }
.trust-badges { 
    display: flex; 
    display: -webkit-flex;
    gap: 1.5rem; font-size: 0.85rem; color: hsl(var(--muted-foreground)); margin-top: 3rem; 
}
.trust-badge { 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 6px; 
}

.dashboard-wrapper { 
    -webkit-perspective: 1200px;
    -moz-perspective: 1200px;
    perspective: 1200px; 
    position: relative; 
}
.main-card {
    background: hsla(var(--card), 0.7); 
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid hsl(var(--border)); 
    -webkit-border-radius: 2.5rem;
    -moz-border-radius: 2.5rem;
    border-radius: 2.5rem;
    padding: 2rem; 
    -webkit-box-shadow: 0 50px 100px -20px rgba(0,0,0,0.15);
    -moz-box-shadow: 0 50px 100px -20px rgba(0,0,0,0.15);
    box-shadow: 0 50px 100px -20px rgba(0,0,0,0.15);
    -webkit-transition: -webkit-transform 0.1s ease-out;
    -moz-transition: -moz-transform 0.1s ease-out;
    transition: transform 0.1s ease-out;
}
.card-header { 
    display: flex; 
    display: -webkit-flex;
    justify-content: space-between; 
    -webkit-justify-content: space-between;
    align-items: flex-start; 
    -webkit-align-items: flex-start;
    margin-bottom: 1.5rem; 
}
.card-header h3 { font-weight: 700; }
.card-header p { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { 
    padding: 1.25rem; 
    -webkit-border-radius: 1.25rem;
    -moz-border-radius: 1.25rem;
    border-radius: 1.25rem; 
    background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border)); 
}
html[lang="en"] .stat-card { border-right: none; border-left: 3px solid; }
.stat-label { 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 6px; color: hsl(var(--muted-foreground)); font-size: 0.8rem; 
}
.stat-sub { font-size: 0.7rem; font-weight: 600; }
.primary-text { color: hsl(var(--primary)); }
.secondary-text { color: hsl(var(--secondary)); }

.floating-badge {
    position: absolute; background: hsl(var(--card)); padding: 0.7rem 1rem;
    -webkit-border-radius: 1rem;
    -moz-border-radius: 1rem;
    border-radius: 1rem; 
    border: 1px solid hsl(var(--border));
    -webkit-box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    -moz-box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    z-index: 10;
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 8px; font-size: 0.85rem; font-weight: 600;
}
.val { font-size: 1.5rem; font-weight: 700; margin: 0.4rem 0; display: block; }
.usage-label { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.8rem; }

.chart-container { 
    display: flex; 
    display: -webkit-flex;
    align-items: flex-end; 
    -webkit-align-items: flex-end;
    gap: 8px; height: 100px; 
    background: hsl(var(--muted)/0.4); padding: 10px; 
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px; 
}
.bar { 
    flex: 1; 
    -webkit-flex: 1;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px; 
}
.bar-1, .bar-4 { height: 40%; background: hsl(var(--primary)); opacity: 0.4; }
.bar-2 { height: 65%; background: hsl(var(--secondary)); }
.bar-3, .bar-6 { height: 85%; background: hsl(var(--primary)); opacity: 0.7; }
.bar-5.highlight { height: 95%; background: var(--gradient); }

.alert-box {
    background: hsla(0, 72%, 51%, 0.08); color: #ef4444; padding: 1rem;
    -webkit-border-radius: 1rem;
    -moz-border-radius: 1rem;
    border-radius: 1rem; 
    font-size: 0.85rem; border: 1px solid hsla(0, 72%, 51%, 0.15);
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 10px; margin-top: 1.5rem;
}
.status-dot { 
    width: 8px; height: 8px; 
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%; 
    background: #10b981; position: relative; 
}

/* Stats Bar */
.stats-bar {
    display: flex;
    display: -webkit-flex;
    justify-content: space-around;
    -webkit-justify-content: space-around;
    padding: 3rem 6%;
    background: var(--gradient);
    color: white;
    margin: 4rem 0;
    text-align: center;
}
.stat-item:hover { 
    -webkit-transform: translateY(-5px);
    -moz-transform: translateY(-5px);
    transform: translateY(-5px); 
}
.stat-item i { font-size: 2rem; margin-bottom: 10px; display: block; }
.stat-item strong {
    font-size: 3rem;
    font-weight: 800;
    display: flex;
    display: -webkit-flex;
    justify-content: center;
    -webkit-justify-content: center;
    align-items: center;
    -webkit-align-items: center;
    margin-bottom: 5px;
    direction: ltr;
}
.counter-sign { margin-left: 2px; }

/* Global section styles */
section { padding: 100px 8%; }
.section-header { text-align: center; margin-bottom: 4rem; padding: 0 20px; }
.section-header h2 { font-size: 2.8rem; color: hsl(var(--foreground)); margin-bottom: 15px; font-weight: 800; line-height: 1.2; margin-top: 0; }
.section-header p { color: hsl(var(--muted-foreground)); font-size: 1.15rem; line-height: 1.6; margin-top: 0; margin-bottom: 0; max-width: 600px; margin-left: auto; margin-right: auto; }
.badge { 
    background: var(--primary-glow); color: hsl(var(--primary)); 
    padding: 8px 20px; 
    -webkit-border-radius: 50px;
    -moz-border-radius: 50px;
    border-radius: 50px; 
    font-size: 0.85rem;
    font-weight: 700; display: inline-block; margin-bottom: 1.5rem;
    border: 1px solid hsla(160, 84%, 39%, 0.1); letter-spacing: 0.5px;
}

/* Features carousel */
.features-carousel { padding: 100px 0;  }
.carousel-container { 
    width: 100%; 
    overflow: hidden;
    padding: 20px 0 40px; 
}

.carousel-track { 
    display: flex;
    display: -webkit-flex;
    gap: 20px; 
    padding: 0;
    width: max-content;
    will-change: transform;
}

.feature-card {
    flex: 0 0 320px;
    -webkit-flex: 0 0 320px;
    min-width: 320px;
    background: hsl(var(--card)); padding: 2.5rem; 
    -webkit-border-radius: var(--radius);
    -moz-border-radius: var(--radius);
    border-radius: var(--radius);
    border: 1px solid hsl(var(--border)); 
    -webkit-transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    -moz-transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative; 
    display: flex; 
    display: -webkit-flex;
    flex-direction: column; 
    -webkit-flex-direction: column;
    height: 100%;
    min-height: 320px;  
}
.feature-card:hover { 
    -webkit-transform: translateY(-12px);
    -moz-transform: translateY(-12px);
    transform: translateY(-12px); 
    border-color: transparent;
    -webkit-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    -moz-box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
}
.feature-card::before {
    content: ""; position: absolute; inset: 0; 
    -webkit-border-radius: var(--radius);
    -moz-border-radius: var(--radius);
    border-radius: var(--radius); 
    padding: 2px;
    background: var(--gradient); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; 
    -webkit-transition: opacity 0.4s;
    -moz-transition: opacity 0.4s;
    transition: opacity 0.4s;
}
.feature-card:hover::before { opacity: 1; }
.feature-card::after {
    content: "←"; position: absolute; bottom: 2rem; left: 2rem; color: hsl(var(--primary));
    font-size: 1.2rem; opacity: 0; 
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    transition: 0.3s;
}
html[lang="en"] .feature-card::after { content: "→"; right: 2rem; left: auto; }
.feature-card:hover::after { opacity: 1; left: 1.5rem; }
html[lang="en"] .feature-card:hover::after { right: 1.5rem; left: auto; }

.icon-box { 
    width: 60px; height: 60px; background: var(--primary-glow); color: hsl(var(--primary));
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    -webkit-border-radius: 18px;
    -moz-border-radius: 18px;
    border-radius: 18px; 
    margin-bottom: 1.8rem; 
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    transition: 0.3s;
}
.feature-card:hover .icon-box { 
    background: var(--gradient); color: white; 
    -webkit-transform: rotate(-5deg) scale(1.1);
    -moz-transform: rotate(-5deg) scale(1.1);
    transform: rotate(-5deg) scale(1.1); 
}
.feature-card h3 { 
    font-size: 1.3rem; font-weight: 800; color: hsl(var(--foreground)); margin-bottom: 1rem; 
    display: flex; 
    display: -webkit-flex;
    flex-direction: column; 
    -webkit-flex-direction: column;
    gap: 5px; 
}
.feature-card p { color: var(--muted-foreground); line-height: 1.7; font-size: 0.95rem; margin: 0; }

/* How It Works */
.how-it-works {  color: hsl(var(--foreground)); }
.how-it-works .section-header { max-width: 650px; margin: 0 auto 70px; }
.steps-wrapper { position: relative; max-width: 1200px; margin: 0 auto; padding: 30px 0; }
.steps-line { position: absolute; top: 65px; left: 10%; right: 10%; height: 2px; background: hsl(var(--border)); z-index: 1; }
.steps-container { 
    display: flex; 
    display: -webkit-flex;
    justify-content: space-between; 
    -webkit-justify-content: space-between;
    align-items: flex-start; 
    -webkit-align-items: flex-start;
    gap: 20px; position: relative; z-index: 2; 
}
.step-item { 
    flex: 1; 
    -webkit-flex: 1;
    text-align: center; 
    display: flex; 
    display: -webkit-flex;
    flex-direction: column; 
    -webkit-flex-direction: column;
    align-items: center; 
    -webkit-align-items: center;
    -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -moz-transition: -moz-transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
}
.step-item:hover { 
    -webkit-transform: translateY(-8px);
    -moz-transform: translateY(-8px);
    transform: translateY(-8px); 
}
.step-icon-wrapper {
    width: 90px; height: 90px; 
    -webkit-border-radius: var(--radius);
    -moz-border-radius: var(--radius);
    border-radius: var(--radius); 
    display: flex;
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center; 
    -webkit-justify-content: center;
    margin-bottom: 30px; position: relative;
    color: white; font-size: 2.2rem; 
    -webkit-box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    -moz-box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    transition: all 0.3s ease;
}
.step-item:hover .step-icon-wrapper { 
    -webkit-box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    -moz-box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15); 
}
.step-number {
    position: absolute; top: -12px; right: -12px; width: 32px; height: 32px;
    background: hsl(var(--card)); color: hsl(var(--primary)); border: 2px solid hsl(var(--primary));
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%; 
    font-size: 14px; font-weight: bold; 
    display: flex;
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center; 
    -webkit-justify-content: center;
    -webkit-box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    -moz-box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.grad-1, .grad-2, .grad-3, .grad-4 { background: var(--gradient); }
.step-title { font-size: 1.35rem; color: hsl(var(--foreground)); margin-bottom: 12px; font-weight: 700; }
.step-desc { font-size: 0.95rem; color: hsl(var(--muted-foreground)); line-height: 1.6; max-width: 250px; margin: 0; }
/* Testimonials */
/* Testimonials - Redesigned */
.testimonials {
    padding: 100px 6%;
    position: relative;
    overflow: hidden;
}

/* Decorative background */
.testimonials::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
   
    pointer-events: none;
    z-index: 0;
}

.testimonials .section-header {
    position: relative;
    z-index: 1;
}

/* Grid layout */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    align-items: start;
}

/* Main card */
/* Fixed size for all cards */
.testimonial-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) + 4px);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;

    /* Fixed size */
    width: 370px;
    height: 300px;
}

/* Colored side line */
.testimonial-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
    border-radius: 0 0 calc(var(--radius) + 4px) calc(var(--radius) + 4px);
}

.testimonial-card:hover::after {
    transform: scaleX(1);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.12);
    border-color: hsl(var(--primary) / 0.2);
}

/* Featured middle card */
.testimonial-card--featured {
    background: var(--gradient);
    border-color: transparent;
    transform: translateY(-12px);
    box-shadow: 0 30px 60px -10px hsla(160, 84%, 39%, 0.3);
}

.testimonial-card--featured::after {
    display: none;
}

.testimonial-card--featured:hover {
    transform: translateY(-20px);
    box-shadow: 0 40px 70px -10px hsla(160, 84%, 39%, 0.4);
}

/* Quote icon */
.testi-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-glow);
    color: hsl(var(--primary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.testimonial-card--featured .quote-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.testimonial-card:hover .quote-icon {
    background: var(--gradient);
    color: white;
    transform: rotate(-5deg) scale(1.1);
}

.testimonial-card--featured:hover .quote-icon {
    background: rgba(255,255,255,0.3);
    transform: rotate(-5deg) scale(1.1);
}

/* Stars */
.stars {
    color: #fbbf24;
    font-size: 0.9rem;
    letter-spacing: 3px;
    margin: 0;
}

.testimonial-card--featured .stars {
    color: rgba(255,255,255,0.9);
}

/* Text */
.testimonial-card p {
    color: hsl(var(--muted-foreground));
    line-height: 1.8;
    font-size: 0.95rem;
    flex: 1;
    margin: 0;
}

.testimonial-card--featured p {
    color: rgba(255,255,255,0.92);
}

/* Bottom area: user + badge */
.testi-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 1rem;
    border-top: 1px solid hsl(var(--border));
    flex-wrap: wrap;
}

.testimonial-card--featured .testi-card-bottom {
    border-top-color: rgba(255,255,255,0.2);
}

/* User information */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-details h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.testimonial-card--featured .user-details h4 {
    color: white;
}

.user-details span {
    font-size: 0.8rem;
    color: hsl(var(--muted-foreground));
}

.testimonial-card--featured .user-details span {
    color: rgba(255,255,255,0.75);
}

/* Avatar */
.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    border: 2px solid hsl(var(--border));
    transition: transform 0.3s ease;
}

.testimonial-card--featured .user-avatar {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.2);
}

.testimonial-card:hover .user-avatar {
    transform: scale(1.08);
}

/* Saving badge */
.saving-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-glow);
    color: hsl(var(--primary));
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid hsla(160, 84%, 39%, 0.15);
    transition: all 0.3s ease;
}

.testimonial-card--featured .saving-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

.testimonial-card:hover .saving-badge {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

.testimonial-card--featured:hover .saving-badge {
    background: rgba(255,255,255,0.3);
}

/* Dark mode */
[data-theme="dark"] .testimonial-card {
    background: hsl(var(--card));
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

[data-theme="dark"] .testimonial-card--featured {
    box-shadow: 0 30px 60px -10px hsla(160, 84%, 45%, 0.25);
}

/* Mobile */
@media (max-width: 900px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .testimonial-card--featured {
        transform: none;
    }

    .testimonial-card--featured:hover {
        transform: translateY(-8px);
    }
}

@media (max-width: 768px) {
    .testimonials-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto;
        gap: 15px;
        padding: 10px 1.5rem 30px;
        margin: 0 -1.5rem;
        scroll-snap-type: x mandatory;
        max-width: none;
    }

    .testimonial-card {
        flex: 0 0 85%;
        scroll-snap-align: center;
        min-width: 280px;
    }

    .testimonial-card--featured {
        transform: none;
    }
}

/* Footer */
.site-footer {
    background: hsla(var(--card), 0.8); 
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid hsl(var(--border)); padding: 5rem 6% 2rem;
    margin-top: 8rem; position: relative;
}
.footer-container { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 4rem; }
.footer-section { 
    display: flex; 
    display: -webkit-flex;
    flex-direction: column; 
    -webkit-flex-direction: column;
    gap: 1.5rem; 
}
.footer-logo { 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 12px; 
}
.footer-logo strong { font-size: 1.5rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-info p { color: hsl(var(--muted-foreground)); font-size: 0.95rem; line-height: 1.8; max-width: 350px; }
.footer-title { font-size: 1.1rem; font-weight: 700; color: hsl(var(--foreground)); position: relative; padding-bottom: 10px; }
.footer-title::after { content: ''; position: absolute; bottom: 0; right: 0; width: 30px; height: 2px; background: var(--gradient); }
.footer-links-wrapper { 
    list-style: none; 
    display: flex; 
    display: -webkit-flex;
    flex-direction: column; 
    -webkit-flex-direction: column;
    gap: 0.8rem; 
}
.footer-links-wrapper a { 
    text-decoration: none; color: hsl(var(--muted-foreground)); 
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    transition: all 0.3s ease; 
    font-size: 0.95rem; 
}
.footer-links-wrapper a:hover { 
    color: hsl(var(--primary)); 
    -webkit-transform: translateX(-5px);
    -moz-transform: translateX(-5px);
    transform: translateX(-5px); 
}
.contact-info a { 
    text-decoration: none; color: hsl(var(--muted-foreground)); 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 12px; font-size: 0.95rem; 
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    transition: 0.3s; 
}
.contact-info a:hover { color: hsl(var(--primary)); }
.social-links { 
    display: flex; 
    gap: 1rem; 
    margin-top: 0.5rem; 
}

.social-links a { 
    width: 42px; 
    height: 42px; 
    border-radius: 12px; 
    background: hsl(var(--muted)); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: hsl(var(--foreground)); 
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1.1); 
    border: 1px solid hsl(var(--border) / 0.5); 
    font-size: 1.2rem;
}

/* Improved hover effects */
.social-links a:hover { 
    background: var(--gradient); 
    color: white; 
    transform: translateY(-3px) scale(1.1); 
    box-shadow: 0 8px 18px var(--primary-glow); 
    border-color: transparent;
}

/* Add a smooth return effect */
.social-links a:active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px var(--primary-glow / 0.6);
}
.social-links a {
    text-decoration: none;
    line-height: 1;
}

@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-content h1 { font-size: 2.8rem; }
    .hero-content p { margin: 0 auto 2rem; }
    .trust-badges { 
        justify-content: center; 
        -webkit-justify-content: center;
        flex-wrap: wrap; 
        -webkit-flex-wrap: wrap;
    }
    .hero-subtitle-container { 
        justify-content: center; 
        -webkit-justify-content: center;
    }
}
@media (max-width: 992px) { 
    .feature-card { 
        flex: 0 0 calc(50% - 20px); 
        -webkit-flex: 0 0 calc(50% - 20px);
    } 
}
@media (max-width: 968px) { .footer-container { grid-template-columns: 1fr 1fr; } .brand-info { grid-column: span 2; } }
@media (max-width: 768px) { 
    .steps-container { 
        flex-direction: column; 
        -webkit-flex-direction: column;
        gap: 50px; 
    } 
    .steps-line { display: none; } 
    .section-title { font-size: 2.2rem; } 
}
@media (max-width: 640px) { 
    .footer-container { grid-template-columns: 1fr; } 
    .brand-info { grid-column: span 1; } 
    .footer-title::after { 
        right: 50%; 
        -webkit-transform: translateX(50%);
        -moz-transform: translateX(50%);
        transform: translateX(50%); 
    } 
    .footer-section { 
        text-align: center; 
        align-items: center; 
        -webkit-align-items: center;
    } 
}
@media (max-width: 600px) { 
    .feature-card { 
        flex: 0 0 100%; 
        -webkit-flex: 0 0 100%;
    } 
}
/* LOGIN & SIGNUP STYLES */

/* Auth Brand Section */
body.login-page .brand-section {
    flex: 1; 
    -webkit-flex: 1;
    background: var(--primary-gradient); 
    display: flex; 
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: center; 
    -webkit-justify-content: center;
    align-items: center; 
    -webkit-align-items: center;
    color: white; text-align: center;
    padding: 40px; position: relative; overflow: hidden;
}
body.login-page .brand-section::after {
    content: ""; position: absolute; width: 500px; height: 500px;
    background: rgba(255,255,255,0.05); 
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%; 
    top: -100px; right: -100px;
}
body.login-page .brand-section .icons { 
    font-size: 4rem; margin-bottom: 30px; 
    display: flex; 
    display: -webkit-flex;
    gap: 30px; position: relative; z-index: 2; 
}
body.login-page .brand-section .icons i { filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); -webkit-filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1)); }
body.login-page .brand-section h1 { font-size: 5.5rem; font-weight: 800; margin-bottom: 15px; letter-spacing: -2px; z-index: 2; }
body.login-page .brand-section p { font-size: 1.3rem; max-width: 450px; line-height: 1.7; opacity: 0.95; font-weight: 300; z-index: 2; }

/* Auth Main Containers */
.login-section {
    flex: 1; 
    -webkit-flex: 1;
    background: var(--card-bg); 
    display: flex; 
    display: -webkit-flex;
    flex-direction: row-reverse; 
    -webkit-flex-direction: row-reverse;
    position: relative; overflow-y: auto; padding: 0;
    -webkit-box-shadow: -10px 0 50px rgba(0,0,0,0.05);
    -moz-box-shadow: -10px 0 50px rgba(0,0,0,0.05);
    box-shadow: -10px 0 50px rgba(0,0,0,0.05); z-index: 5;
    align-items: stretch;
}
body.signup-page .card {
    background: var(--card-bg);
    width: 100%;
    max-width: 550px;

    padding: 30px 40px;

    max-height: 85vh;
    overflow-y: auto;

    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;

    -webkit-box-shadow: 0 4px 25px rgba(0,0,0,0.03);
    -moz-box-shadow: 0 4px 25px rgba(0,0,0,0.03);
    box-shadow: 0 4px 25px rgba(0,0,0,0.03);

    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    transition: 0.3s;

    margin: 20px;
}
body.signup-page .card::-webkit-scrollbar {
    width: 6px;
}

body.signup-page .card::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Auth Specific Controls */
body.login-page .controls { 
    position: absolute; top: 25px; 
    display: flex; 
    display: -webkit-flex;
    gap: 12px; z-index: 10; 
}
body.login-page[dir="rtl"] .controls { right: 30px; left: auto; }
body.login-page[dir="ltr"] .controls { left: 30px; right: auto; }

.page-controls { 
    position: absolute; top: 20px; right: 20px; 
    display: flex; 
    display: -webkit-flex;
    gap: 10px; 
}
[dir="ltr"] .page-controls { right: auto; left: 20px; }

.control-group { 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    background: transparent; border: none; box-shadow: none; padding: 0; 
}
.icon-btn { background: transparent; border: none; padding: 10px; color: var(--text-dark); cursor: pointer; }
.icon-btn:hover { 
    background: var(--bg-light); color: var(--primary-color); 
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}
.control-btn { 
    background: var(--card-bg); border: 1px solid var(--input-border); padding: 8px 12px; 
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px; 
    cursor: pointer; color: var(--text-dark); font-weight: bold; 
}

.lang-switcher { 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    font-weight: 800; letter-spacing: 0.5px; 
}
.lang-switcher span { opacity: 0.3; font-weight: 400; margin: 0 2px; }
.lang-switcher b { color: var(--primary-color); }
#themeIcon { font-size: 1.1rem; }

/* Form Layouts & Headers */
.form-container { width: 100%; max-width: 450px; margin: auto; padding: 40px; display: none; align-self: center; }
.form-container.active { 
    display: block; 
    -webkit-animation: slideIn 0.5s ease-out;
    -moz-animation: slideIn 0.5s ease-out;
    animation: slideIn 0.5s ease-out; 
}
@-webkit-keyframes slideIn { from { opacity: 0; -webkit-transform: translateX(20px); } to { opacity: 1; -webkit-transform: translateX(0); } }
@-moz-keyframes slideIn { from { opacity: 0; -moz-transform: translateX(20px); } to { opacity: 1; -moz-transform: translateX(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.login-header, .header { text-align: center; margin-bottom: 35px; }
.login-header h2, .header h1 { font-size: 2.2rem; margin-bottom: 12px; font-weight: 800; color: var(--text-dark); }
.header h1 { font-size: 1.6rem; }
.login-header p, .header p { color: var(--text-gray); font-size: 1rem; }
.back-nav { 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: flex-end; 
    -webkit-justify-content: flex-end;
    color: var(--text-muted); font-size: 0.85rem; text-decoration: none; margin-bottom: 20px; 
}
[dir="ltr"] .back-nav { 
    flex-direction: row-reverse; 
    -webkit-flex-direction: row-reverse;
}

/* Navigation & Tabs */
.stepper { 
    display: flex; 
    display: -webkit-flex;
    justify-content: space-between; 
    -webkit-justify-content: space-between;
    align-items: center; 
    -webkit-align-items: center;
    margin-bottom: 50px; position: relative; padding: 0 5px; 
}
.stepper::before { 
    content: ""; position: absolute; top: 20px; left: 0; right: 0; height: 3px; background: var(--input-border); z-index: 1; 
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px; 
}
.step { 
    width: 45px; height: 45px; 
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%; 
    background: var(--bg-light); color: var(--text-gray); z-index: 2; 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center; 
    -webkit-justify-content: center;
    font-size: 1rem; font-weight: 700; border: 2px solid var(--input-border); 
}
.step.active { 
    background: var(--primary-color); color: white; border-color: var(--primary-color); 
    -webkit-box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
    -moz-box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3); 
}
.step.completed { background: var(--success-color); color: white; border-color: var(--success-color); }
.step-label { position: absolute; top: 50px; font-size: 0.75rem; white-space: nowrap; color: var(--text-gray); font-weight: 600; }
.step.active .step-label { color: var(--primary-color); }

.role-switcher, .tabs { 
    display: flex; 
    display: -webkit-flex;
    background: transparent; padding: 4px; 
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px; 
    margin-bottom: 30px; border: 1px solid var(--input-border); 
}
.tabs { 
    background: var(--tab-bg); padding: 4px; 
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px; 
    margin-bottom: 25px; border: none; 
}
.role-switcher button, .tab { 
    flex: 1; 
    -webkit-flex: 1;
    padding: 12px; border: none; background: none; cursor: pointer; 
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px; 
    color: var(--text-gray); font-weight: 700; 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    justify-content: center; 
    -webkit-justify-content: center;
    gap: 10px; font-family: inherit; 
}
.tab { 
    padding: 10px; 
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px; 
}

/* Role switcher active style */
.role-switcher button.active, 
.tab.active { 
    background: transparent !important; 
    color: var(--primary-color) !important; 
    box-shadow: none; 
}

/* Improved flat back button */
.back-landing {
    display: inline-flex;
    display: -webkit-inline-flex;
    align-items: center;
    -webkit-align-items: center;
    justify-content: center;
    -webkit-justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    -webkit-border-radius: var(--radius);
    -moz-border-radius: var(--radius);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-main);
   
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light icon with animation */
.back-landing i {
    font-size: 1rem;
    -webkit-transition: -webkit-transform 0.3s ease;
    -moz-transition: -moz-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.back-landing:hover i {
    -webkit-transform: translateX(-3px);
    -moz-transform: translateX(-3px);
    transform: translateX(-3px);
}

/* RTL support */
html[dir="rtl"] .back-landing:hover i {
    -webkit-transform: translateX(3px);
    -moz-transform: translateX(3px);
    transform: translateX(3px);
}

/* Inside the controls group */
.control-group .back-landing {
    margin-inline-end: 10px;
}

/* Inputs & Grids */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full { grid-column: span 2; }
.input-group { margin-bottom: 22px; }
.grid .input-group { margin-bottom: 0; }
.input-group label { display: block; font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; color: var(--text-dark); }
.grid .input-group label { font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }

.field-wrapper, .field { 
    position: relative; 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
}
.field-wrapper input, .field input { 
    width: 100%; padding: 16px 50px; border: 1px solid var(--input-border); 
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px; 
    background: transparent; color: var(--text-dark); outline: none; font-size: 0.95rem; font-family: inherit; 
}
.field input { 
    padding: 11px 15px; padding-right: 40px; border: 1px solid var(--input-border); 
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px; 
    font-size: 0.85rem; 
}
[dir="ltr"] .field input { padding-right: 15px; padding-left: 40px; }
.field-wrapper input:focus, .field input:focus { 
    border-color: var(--primary-color); 
    -webkit-box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
    -moz-box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1); 
}
.field-wrapper input.error, .input-group.error-active input { border-color: var(--error-color) !important; }

.field-wrapper i.main-icon, .field i.main-icon { position: absolute; color: var(--text-gray); font-size: 1.1rem; }
.field-wrapper i.main-icon { 
    top: 50%; 
    -webkit-transform: translateY(-50%); 
    -moz-transform: translateY(-50%); 
    transform: translateY(-50%); 
}
[dir="rtl"] .field-wrapper i.main-icon { right: 18px; }
[dir="ltr"] .field-wrapper i.main-icon { left: 18px; }
.field i.main-icon { right: 15px; font-size: 0.9rem; }
[dir="ltr"] .field i.main-icon { right: auto; left: 15px; }

.toggle-eye, .eye-btn { position: absolute; background: none; border: none; cursor: pointer; color: var(--text-gray); z-index: 5; }
.toggle-eye { 
    top: 50%; 
    -webkit-transform: translateY(-50%); 
    -moz-transform: translateY(-50%); 
    transform: translateY(-50%); 
    padding: 5px; 
}
[dir="rtl"] .toggle-eye { left: 15px; }
[dir="ltr"] .toggle-eye { right: 15px; }
.eye-btn { left: 12px; }
[dir="ltr"] .eye-btn { left: auto; right: 12px; }

/* Buttons */
.submit-btn, .btn-submit { 
    width: 100%; padding: 16px; background: var(--primary-gradient); color: white; border: none; 
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px; 
    font-weight: 700; font-size: 1.1rem; cursor: pointer; margin-top: 15px; 
    -webkit-box-shadow: 0 8px 20px rgba(74, 144, 226, 0.25); 
    -moz-box-shadow: 0 8px 20px rgba(74, 144, 226, 0.25); 
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.25); 
    font-family: inherit; 
}
.btn-submit { 
    padding: 13px; margin-top: 20px; 
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px; 
    font-size: 1rem; 
}
.submit-btn:hover:not(:disabled), .btn-submit:hover { 
    -webkit-transform: translateY(-3px); 
    -moz-transform: translateY(-3px); 
    transform: translateY(-3px); 
    -webkit-box-shadow: 0 12px 25px rgba(74, 144, 226, 0.35); 
    -moz-box-shadow: 0 12px 25px rgba(74, 144, 226, 0.35); 
    box-shadow: 0 12px 25px rgba(74, 144, 226, 0.35); 
}
.submit-btn:active:not(:disabled), .btn-submit:active { 
    -webkit-transform: translateY(-1px); 
    -moz-transform: translateY(-1px); 
    transform: translateY(-1px); 
}
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* OTP & Requirements */
.otp-inputs { 
    display: flex; 
    display: -webkit-flex;
    gap: 12px; justify-content: center; 
    -webkit-justify-content: center;
    margin: 30px 0; 
}
.otp-inputs input { 
    width: 50px; height: 60px; text-align: center; font-size: 1.5rem; 
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px; 
    border: 2px solid var(--input-border); background: var(--bg-light); color: var(--text-dark); font-weight: 700; padding: 0; 
}
.otp-inputs input:focus { 
    border-color: var(--primary-color); background: var(--card-bg); outline: none; 
    -webkit-box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1); 
    -moz-box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1); 
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1); 
}
.requirements-box { 
    background: var(--bg-light); padding: 20px; 
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px; 
    font-size: 0.85rem; margin-bottom: 25px; border: 1px dashed var(--input-border); display: none; 
}
.requirements-box.visible { 
    display: block; 
    -webkit-animation: fadeIn 0.3s ease; 
    -moz-animation: fadeIn 0.3s ease; 
    animation: fadeIn 0.3s ease; 
}
.requirements-box ul { list-style: none; }
.requirements-box li { 
    margin-bottom: 10px; color: var(--text-gray); 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 12px; 
}
.requirements-grid { 
    grid-column: span 2; background: var(--tab-bg); padding: 15px; 
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px; 
    margin-top: 10px; display: none; grid-template-columns: 1fr 1fr; gap: 8px; 
}
.requirements-grid.visible { 
    display: grid; 
    -webkit-animation: fadeIn 0.3s ease;
    -moz-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}
.req-item { 
    font-size: 0.75rem; color: var(--text-muted); 
    display: flex; 
    display: -webkit-flex;
    align-items: center; 
    -webkit-align-items: center;
    gap: 8px; 
    -webkit-transition: 0.3s;
    -moz-transition: 0.3s;
    transition: 0.3s; 
}
.req-item i { font-size: 0.85rem; }
.req-item.valid { color: var(--success-color); font-weight: 600; }

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

/* Footer Links & Utils */
.footer-links { text-align: center; margin-top: 35px; font-size: 0.95rem; }
.footer-links p { margin-bottom: 10px; }
.footer-links a { 
    color: var(--primary-color); text-decoration: none; font-weight: 700; 
    -webkit-transition: 0.2s;
    -moz-transition: 0.2s;
    transition: 0.2s; 
    cursor: pointer; 
}
.footer-links a:hover { text-decoration: underline; opacity: 0.8; }
.validation-msg, .error-text { color: var(--error-color); font-size: 0.8rem; margin-top: 5px; display: none; }
.error-text { font-size: 0.7rem; margin-top: 4px; }
.input-group.error-active .error-text { display: block; }
.hidden { display: none; }

@media (max-width: 1024px) { 
    body.login-page .brand-section { display: none; } 
    .login-section { flex-direction: column; padding: 60px 20px; } 
}
@media (max-width: 480px) { 
    .grid { grid-template-columns: 1fr; } 
    .full { grid-column: span 1; } 
    .requirements-grid { grid-template-columns: 1fr; } 
}


/* Fix disappearing text issue */

/* Default button state in high contrast mode */
.high-contrast .role-switcher button {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

/* Active / selected button state */
.high-contrast .role-switcher button.active {
    background-color: #ffffff !important;
    color: #000000 !important;
    outline: 4px solid #ffff00 !important;
    border-color: #ffffff !important;
}

/* Force text and icon inside the active button to be black */
.high-contrast .role-switcher button.active span,
.high-contrast .role-switcher button.active i {
    color: #000000 !important;
}

/* Fix accessibility menu buttons overflowing */

/* Make the menu width flexible instead of fixed at 250px */
.access-menu {
    width: auto !important; 
    min-width: 260px !important;
    max-width: 90vw !important;
}

/* Access menu item wrap */
.access-item {
    flex-wrap: wrap !important;
    gap: 10px !important;
    height: auto !important;
}

/* Access menu buttons */
.access-item .wide-btn,
.access-item .btn-group {
    flex: 1 1 auto !important;
    white-space: normal !important;
    word-break: break-word !important;
    height: auto !important;
    min-height: 40px !important;
}

.access-item span {
    white-space: normal !important;
    flex: 1 1 100% !important;
}

/* Interface Scaling Support */

html[data-text-size="large"] input,
html[data-text-size="large"] button,
html[data-text-size="large"] .step-label {
    font-size: 1.05rem;
}

/* Theme and language toggle buttons */
/* Theme and language buttons */
body.login-page .controls {
    position: static !important;
    display: flex !important;
    width: 100% !important;
    margin-bottom: 24px !important;
    align-items: center !important;
    gap: 10px !important;
    justify-content: flex-start !important;
}

html[dir="rtl"] body.login-page .controls {
    justify-content: flex-start !important;
}

html[dir="ltr"] body.login-page .controls {
    justify-content: flex-start !important;
}

body.login-page .controls .control-group {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
}

.controls .theme-toggle,
.controls .lang-toggle {
    width: 2.75rem !important;
    height: 2.75rem !important;
    padding: 0 !important;
    border-radius: 12px !important;
    background: hsl(var(--muted)) !important;
    color: hsl(var(--foreground)) !important;
    border: 1px solid hsl(var(--border)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.controls .theme-toggle:hover,
.controls .lang-toggle:hover {
    background: var(--gradient) !important;
    color: white !important;
    border-color: transparent !important;
    transform: translateY(-3px) scale(1.1) !important;
    box-shadow: 0 8px 18px hsla(160, 84%, 39%, 0.3) !important;
}

.controls .theme-toggle:active,
.controls .lang-toggle:active {
    transform: scale(0.95) !important;
}

/* Screen Reader Only */
.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;
}

.form-container {
    width: 100%;
    max-width: 450px;
    margin: auto;
    padding: 40px;
    display: none;
    align-self: center;

    /* Add only these two properties */
    max-height: 100vh;
    overflow-y: auto;
}

.login-section {
    flex: 1;
    background: var(--card-bg);
    display: flex;
    flex-direction: row-reverse;
    position: relative;
    overflow-y: auto;
    padding: 0;
    box-shadow: -10px 0 50px rgba(0,0,0,0.05);
    z-index: 5;
    align-items: stretch;
}

/* Scrollbar - Login Page */
body.login-page .form-container::-webkit-scrollbar {
    width: 6px;
}

body.login-page .form-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

body.login-page .form-container::-webkit-scrollbar-track {
    background: transparent;
}

body.signup-page {
    flex-direction: row;
}

body.login-page .brand-section,
body.signup-page .brand-section {
    flex: 1;
    background: var(--primary-gradient);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

body.login-page .brand-section::after,
body.signup-page .brand-section::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

body.login-page .brand-section .icons,
body.signup-page .brand-section .icons {
    font-size: 4rem;
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    position: relative;
    z-index: 2;
}

body.login-page .brand-section h1,
body.signup-page .brand-section h1 {
    font-size: 5.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -2px;
    z-index: 2;
}

body.login-page .brand-section p,
body.signup-page .brand-section p {
    font-size: 1.3rem;
    max-width: 450px;
    line-height: 1.7;
    opacity: 0.95;
    font-weight: 300;
    z-index: 2;
}

@media (max-width: 1024px) { 
    body.login-page .brand-section,
    body.signup-page .brand-section { display: none; } 
}

/* Fix full brand section display on signup page */
body.signup-page {
    height: 100vh !important;
    overflow: hidden !important;
    align-items: stretch !important;
}

body.signup-page .brand-section {
    flex: 1;
    height: 100vh !important;
    min-height: 100vh !important;
    position: sticky !important;
    top: 0 !important;
    align-self: flex-start !important;
}

body.signup-page .card {
    align-self: center !important;
    height: fit-content !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    flex-shrink: 0 !important;
}

/* RTL: form on the right, brand on the left */
html[dir="rtl"] body.signup-page {
    flex-direction: row-reverse;
}

/* LTR: form on the left, brand on the right */
html[dir="ltr"] body.signup-page {
    flex-direction: row;
}

/* Fix login page and all its content */
body.login-page {
    height: 100vh !important;
    overflow: hidden !important;
}

body.login-page .login-section {
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
}

body.login-page .brand-section {
    height: 100vh !important;
    min-height: 100vh !important;
    flex-shrink: 0 !important;
}

body.login-page .form-container {
    height: 100vh !important;
    overflow-y: auto !important;
    padding: 40px !important;
    display: none;
}

body.login-page .form-container.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* RTL: brand on the left, form on the right */
html[dir="rtl"] body.login-page .login-section {
    flex-direction: row-reverse;
}

/* LTR: brand on the right, form on the left */
html[dir="ltr"] body.login-page .login-section {
    flex-direction: row;
}

/* Final password recovery page fixes */

/* OTP box visibility */
.otp-inputs {
    display: flex !important;
    gap: 8px !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin: 30px 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.otp-inputs input {
    width: calc((100% - 40px) / 6) !important;
    max-width: 55px !important;
    height: 55px !important;
    min-width: 0 !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    border-radius: 12px !important;
    border: 2px solid var(--input-border) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-dark) !important;
    font-weight: 800 !important;
    padding: 0 !important;
    line-height: normal !important;
    caret-color: var(--primary-color) !important;
    transition: all 0.3s ease !important;
}

.otp-inputs input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2) !important;
    background-color: var(--bg-light) !important;
}

/* Fully enable high contrast mode for the stepper */
body.high-contrast .stepper::before {
    background-color: #FFFFFF !important;
}

body.high-contrast .step {
    background-color: #000000 !important;
    border: 2px solid #FFFFFF !important;
    color: #FFFFFF !important;
}

body.high-contrast .step.active {
    background-color: #F0E442 !important;
    color: #000000 !important;
    border: 2px solid #F0E442 !important;
}

body.high-contrast .step.completed {
    background-color: #009E73 !important;
    color: #FFFFFF !important;
    border: 2px solid #009E73 !important;
}

body.high-contrast .step-label {
    color: #FFFFFF !important;
}

body.high-contrast .step.active .step-label {
    color: #F0E442 !important;
}

/* Apply high contrast mode to OTP input boxes */
body.high-contrast .otp-inputs input {
    background-color: #000000 !important;
    border: 3px solid #FFFFFF !important;
    color: #FFFFFF !important;
}

body.high-contrast .otp-inputs input:focus {
    border-color: #F0E442 !important;
    outline: none !important;
    box-shadow: 0 0 0 3px #F0E442 !important;
}

/* Strict password recovery page fixes */

/* OTP container layout */
.otp-inputs {
    display: flex !important;
    gap: 2vw !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* OTP box distribution */
.otp-inputs input {
    flex: 1 !important;
    min-width: 0 !important;
    height: 55px !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    border: 2px solid var(--input-border) !important;
    background-color: var(--bg-light) !important;
    color: var(--text-dark) !important;
    -webkit-text-fill-color: var(--text-dark) !important;
}

.otp-inputs input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15) !important;
    background-color: var(--card-bg) !important;
}

/* High contrast mode for OTP boxes */
body.high-contrast .otp-inputs input {
    background-color: #000000 !important;
    border: 3px solid #FFFFFF !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    border-radius: 4px !important;
}

body.high-contrast .otp-inputs input:focus {
    border-color: #F0E442 !important;
    box-shadow: 0 0 0 4px #F0E442 !important;
    color: #F0E442 !important;
    -webkit-text-fill-color: #F0E442 !important;
}

/* High contrast mode for the stepper */
body.high-contrast .stepper::before {
    background: #FFFFFF !important;
    height: 3px !important;
}

body.high-contrast .step {
    background: #000000 !important;
    color: #FFFFFF !important;
    border: 3px solid #FFFFFF !important;
}

body.high-contrast .step.active {
    background: #000000 !important;
    color: #F0E442 !important;
    border: 3px solid #F0E442 !important;
}

body.high-contrast .step.completed {
    background: #000000 !important;
    color: #009E73 !important;
    border: 3px solid #009E73 !important;
}

body.high-contrast .step.completed i {
    color: #009E73 !important;
}

body.high-contrast .step-label {
    color: #FFFFFF !important;
    font-weight: 800 !important;
}

body.high-contrast .step.active .step-label {
    color: #F0E442 !important;
}

body.high-contrast .step.completed .step-label {
    color: #009E73 !important;
}

/* Final strict OTP fixes */

/* OTP boxes no scroll */
.otp-inputs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 30px 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    direction: ltr !important;
}

.otp-inputs input.otp-box {
    flex: 1 1 0px !important;
    min-width: 0 !important;
    height: 55px !important;
    text-align: center !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    border: 2px solid var(--input-border) !important;
    background-color: var(--bg-light) !important;
    color: var(--text-dark) !important;
    -webkit-text-fill-color: var(--text-dark) !important;
    padding: 0 !important;
}

/* High contrast mode for OTP boxes */
body.high-contrast .otp-inputs input.otp-box {
    background-color: #000000 !important;
    border: 3px solid #FFFFFF !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

body.high-contrast .otp-inputs input.otp-box:focus {
    border-color: #F0E442 !important;
    box-shadow: 0 0 0 4px #F0E442 !important;
    color: #F0E442 !important;
    -webkit-text-fill-color: #F0E442 !important;
}

/* OTP caret blue in HC */
body.high-contrast .otp-inputs input,
body.high-contrast .otp-inputs input.otp-box {
    caret-color: var(--hc-text-secondary) !important;
}

/* High contrast mode for the stepper */
body.high-contrast .stepper::before { 
    background: #FFFFFF !important; 
    height: 3px !important;
}
body.high-contrast .step { 
    background: #000000 !important; 
    color: #FFFFFF !important; 
    border: 3px solid #FFFFFF !important; 
}
body.high-contrast .step.active { 
    color: #F0E442 !important; 
    border-color: #F0E442 !important; 
    background: #000000 !important;
}
body.high-contrast .step.completed { 
    color: #009E73 !important; 
    border-color: #009E73 !important; 
    background: #000000 !important;
}
body.high-contrast .step.completed i { 
    color: #009E73 !important; 
}
body.high-contrast .step-label { 
    color: #FFFFFF !important; 
}
/* Fix focus highlight and stepper in high contrast mode */

/* HC field focus */
body.high-contrast .field-wrapper input:focus,
body.high-contrast .field input:focus,
body.high-contrast .input-group input:focus,
body.high-contrast input:focus,
body.high-contrast textarea:focus,
body.high-contrast select:focus {
    border-color: #F0E442 !important;
    box-shadow: 0 0 0 4px rgba(240, 228, 66, 0.25) !important;
    outline: none !important;
}

/* Change field icons to yellow when the input is focused */
body.high-contrast .field-wrapper input:focus ~ i.main-icon,
body.high-contrast .field-wrapper input:focus ~ .toggle-eye i {
    color: #F0E442 !important;
}

/* Fix general focus-visible outline for keyboard navigation */
body.high-contrast *:focus-visible {
    outline: 3px solid #F0E442 !important;
    outline-offset: 3px !important;
}

/* HC stepper colors */
body.high-contrast .step {
    background: #000000 !important;
    color: #FFFFFF !important;
    border: 3px solid #FFFFFF !important;
}

/* HC active step */
body.high-contrast .step.active {
    background: #F0E442 !important;
    color: #000000 !important;
    border-color: #F0E442 !important;
}

body.high-contrast .step.active .step-label {
    color: #F0E442 !important;
}

/* Completed step: replace normal green with clear white */
body.high-contrast .step.completed {
    background: #000000 !important;
    color: #FFFFFF !important;
    border-color: #FFFFFF !important;
}

body.high-contrast .step.completed i {
    color: #FFFFFF !important;
}

body.high-contrast .step.completed .step-label {
    color: #FFFFFF !important;
}

/* Full high contrast color override fix */

/* Re-map core site colors in high contrast mode */
body.high-contrast {
    --success-color: #F0E442 !important;
    --error-color: #FF5555 !important;
    --text-muted: #FFFFFF !important;
    --text-gray: #FFFFFF !important;
}

/* HC met requirements */
body.high-contrast .requirements-grid .req-item.valid,
body.high-contrast .requirements-grid .req-item.valid i,
body.high-contrast .requirements-grid .req-item.valid span,
body.high-contrast .requirements-box .req-item.valid,
body.high-contrast .requirements-box .req-item.valid i,
body.high-contrast .requirements-box .req-item.valid span {
    color: #F0E442 !important;
    font-weight: 900 !important;
}

/* Force normal incomplete requirements to white */
body.high-contrast .requirements-grid .req-item,
body.high-contrast .requirements-grid .req-item i,
body.high-contrast .requirements-grid .req-item span,
body.high-contrast .requirements-box .req-item,
body.high-contrast .requirements-box .req-item i,
body.high-contrast .requirements-box .req-item span {
    color: #FFFFFF !important;
}

/* Error messages */
body.high-contrast .error-text,
body.high-contrast .validation-msg {
    color: #FF5555 !important;
    font-weight: bold !important;
}

/* Final fix for requirement circles */

/* Force any check circle and its text to bright yellow */
body.high-contrast i.fa-circle-check,
body.high-contrast .fa-circle-check,
body.high-contrast .requirements-grid .valid,
body.high-contrast .requirements-grid .valid i,
body.high-contrast .requirements-grid .valid span,
body.high-contrast .requirements-box li[style*="success-color"] i,
body.high-contrast .requirements-box li[style*="success-color"] span,
body.high-contrast ul[id^="req"] i.fa-circle-check,
body.high-contrast ul[id^="req"] i.fa-circle-check + span {
    color: #F0E442 !important;
    -webkit-text-fill-color: #F0E442 !important;
    font-weight: 900 !important;
}

/* Force empty circles and their text to white */
body.high-contrast i.fa-circle,
body.high-contrast .fa-circle,
body.high-contrast .requirements-grid .req-item:not(.valid),
body.high-contrast .requirements-grid .req-item:not(.valid) i,
body.high-contrast .requirements-grid .req-item:not(.valid) span,
body.high-contrast .requirements-box li[style*="text-gray"] i,
body.high-contrast .requirements-box li[style*="text-gray"] span,
body.high-contrast ul[id^="req"] i.fa-circle,
body.high-contrast ul[id^="req"] i.fa-circle + span {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

/* Scrollbar - High Contrast - Login Page */
body.high-contrast.login-page .form-container::-webkit-scrollbar-thumb {
    background: #56B4E9 !important;
}

/* High contrast: password requirements box background */
body.high-contrast .requirements-grid,
body.high-contrast #resetPasswordRequirements,
body.high-contrast #passwordRequirements,
body.high-contrast .requirements-box {
    background: #000000 !important;
    border: 2px solid #FFFFFF !important;
    border-radius: 12px !important;
}

/* LTR - Login: form on the right, brand on the left */
html[dir="ltr"] body.login-page .login-section {
    flex-direction: row-reverse;
}

/* LTR - Signup: card on the right, brand on the left */
html[dir="ltr"] body.signup-page {
    flex-direction: row-reverse;
}

.role-switcher {
    width: 100%;
}

.role-switcher button {
    flex: 1;
    min-height: 48px;
    font-size: 1rem;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: hsl(var(--foreground));
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
}

.mobile-menu.open {
    display: flex;
    pointer-events: all;
}

.mobile-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: overlayIn 0.25s ease both;
}

@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.mobile-menu-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(80vw, 300px);
    background: hsl(var(--card));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 80px 0 40px;
    box-shadow: 4px 0 40px rgba(0,0,0,0.15);
    animation: panelSlideIn 0.3s cubic-bezier(0.16,1,0.3,1) both;
}

html[dir="rtl"] .mobile-menu-panel { right: 0; left: auto; border-left: 1px solid hsl(var(--border)); }
html[dir="ltr"] .mobile-menu-panel { left: 0; right: auto; border-right: 1px solid hsl(var(--border)); }

@keyframes panelSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
html[dir="ltr"] .mobile-menu-panel { animation-name: panelSlideInLTR; }
@keyframes panelSlideInLTR { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.mobile-nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: hsl(var(--foreground));
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    border-bottom: 1px solid hsl(var(--border));
    transition: all 0.2s ease;
}

.mobile-nav-link:hover, .mobile-nav-link:focus {
    color: hsl(var(--primary));
    background: hsl(var(--muted));
    padding-right: 2rem;
}

html[dir="ltr"] .mobile-nav-link:hover, html[dir="ltr"] .mobile-nav-link:focus {
    padding-left: 2rem;
    padding-right: 1.5rem;
}

.mobile-menu-ctas {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 1.5rem;
    margin-top: auto;
    border-top: 1px solid hsl(var(--border));
}

.mobile-menu-ctas .btn {
    justify-content: center !important;
    width: 100% !important;
    padding: 0.9rem !important;
    font-size: 1rem !important;
    text-align: center;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 4px 16px hsla(160, 84%, 39%, 0.4),
                0 2px 6px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px) scale(0.9);
    transition:
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
    font-size: 1.1rem;
}

/* RTL: left side of the screen */
html[dir="rtl"] .back-to-top {
    left: 2rem;
    right: auto;
}

/* LTR: right side of the screen */
html[dir="ltr"] .back-to-top {
    right: 2rem;
    left: auto;
}

/* Visible state */
.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1) !important;
    box-shadow: 0 12px 28px hsla(160, 84%, 39%, 0.5),
                0 4px 12px rgba(0,0,0,0.15);
}

.back-to-top:active {
    transform: scale(0.95) !important;
    box-shadow: 0 4px 10px hsla(160, 84%, 39%, 0.3);
}

/* High contrast mode */
body.high-contrast .back-to-top {
    background: #E69F00 !important;
    background-image: none !important;
    color: #000000 !important;
    border: 3px solid #FFFFFF !important;
    box-shadow: none !important;
}

body.high-contrast .back-to-top:hover {
    background: #F0E442 !important;
    border-color: #FFFFFF !important;
}

@media (max-width: 768px) {
    .hamburger-btn { display: flex !important; }
}

/* General fix */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}


/* Header */
@media (max-width: 768px) {

    header {
        padding: 0.75rem 4% !important;
        gap: 0;
        flex-wrap: nowrap;
        height: auto !important;
        min-height: 62px;
    }

    .logo {
        padding: 5px 8px !important;
        gap: 8px !important;
        font-size: 1.25rem !important;
        background: transparent !important;
        border-color: transparent !important;
        flex-shrink: 0;
    }

    .logo-img-wrapper {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
    }

    .nav-links {
        display: none !important;
    }

    body:not(.login-page):not(.signup-page) .controls {
        gap: 6px !important;
        flex-shrink: 0;
    }

    /* Hide mobile CTA duplicate */
    body:not(.login-page):not(.signup-page) .controls .btn-primary {
        display: none !important;
    }

    /* Hide mobile login duplicate */
    body:not(.login-page):not(.signup-page) .controls .login-link {
        display: none !important;
    }

    .theme-toggle,
    .lang-toggle {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        font-size: 0.85rem !important;
        flex-shrink: 0;
    }
}


/* Hero section */
@media (max-width: 768px) {

    .hero {
        display: flex !important;
        flex-direction: column !important;
        padding: 5.5rem 1.2rem 2rem !important;
        gap: 2rem !important;
        text-align: center !important;
    }

    .hero-subtitle-container {
        justify-content: center !important;
        font-size: 0.9rem;
    }

    .hero-content h1 {
        font-size: clamp(1.9rem, 7vw, 2.5rem) !important;
        line-height: 1.25 !important;
        margin-bottom: 1rem !important;
    }

    .hero-content p {
        font-size: 0.95rem !important;
        line-height: 1.7 !important;
        margin: 0 auto 1.5rem !important;
        max-width: 100% !important;
        color: hsl(var(--muted-foreground));
    }

    .hero-btns {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        align-items: center !important;
    }

    .main-cta-btn {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1.05rem !important;
        justify-content: center !important;
    }

    .btn-secondary {
        width: 100% !important;
        padding: 0.9rem !important;
        font-size: 1rem !important;
        justify-content: center !important;
    }

    .trust-badges {
        margin-top: 1.5rem !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.8rem !important;
        font-size: 0.8rem !important;
    }

    .dashboard-wrapper {
        transform: none !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .floating-badge {
        display: none !important;
    }

    .main-card {
        padding: 1.25rem !important;
        border-radius: 1.5rem !important;
    }

    .val {
        font-size: 1.2rem !important;
    }

    .chart-container {
        height: 80px !important;
    }
}


/* Stats bar */
@media (max-width: 768px) {

    .stats-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
        padding: 2rem 1.25rem !important;
        margin: 2rem 0 !important;
        border-radius: 0 !important;
    }

    .stat-item {
        text-align: center;
    }

    .stat-item i {
    /* Responsive icon scale */
        font-size: clamp(1rem, 1.4em, 2.5rem) !important;
        margin-bottom: 0.4em;
    }

    .stat-item strong {
    /* Number scales proportionally with font size */
        font-size: clamp(1.4rem, 1.75em, 3.5rem) !important;
        line-height: 1.1;
    }

    .stat-item span {
    /* Description text also scales */
        font-size: clamp(0.7rem, 0.85em, 1.2rem) !important;
        display: block;
        margin-top: 0.2em;
        line-height: 1.4;
    }
}


/* Features section */

/* Navigation dots */
.features-dots {
    display: none;
}

@media (max-width: 768px) {

    .features-carousel {
        padding: 60px 0 !important;
    }

    .features-carousel .section-header {
        padding: 0 1.2rem;
    }

    /* Container: manual finger scrolling */
    .carousel-container {
        overflow-x: auto !important;
        overflow-y: visible !important;
        padding: 4px 0 24px !important;
        margin: 0 -1.2rem !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        cursor: grab;
    }

    .carousel-container:active {
        cursor: grabbing;
    }

    .carousel-container::-webkit-scrollbar {
        display: none;
    }

    /* Track: content-based width without automatic transform */
    .carousel-track {
        width: max-content !important;
        transform: none !important;
        padding: 10px 1.2rem !important;
        gap: 14px !important;
    /* No will-change here because movement is manual */
    }

    /* Each card: snap + screen-friendly width */
    .feature-card,
    .feature-card.cloned {
        flex: 0 0 82% !important;
        min-width: 260px !important;
        max-width: 360px !important;
        padding: 1.5rem !important;
        border-radius: 20px !important;
        min-height: 260px !important;
        scroll-snap-align: center !important;
    }

    /* Hide cloned cards on mobile because they are not needed */
    .feature-card.cloned {
        display: none !important;
    }

    .icon-box {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        margin-bottom: 1.2rem;
    }

    .feature-card h3 {
        font-size: 1.1rem !important;
    }

    .feature-card p {
        font-size: 0.9rem !important;
    }

    .features-dots {
        display: flex !important;
        justify-content: center;
        gap: 7px;
        margin-top: 8px;
        padding: 0 1.2rem;
    }

    .features-dots .fdot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: hsl(var(--border));
        border: none;
        padding: 0;
        cursor: pointer;
        transition: all 0.3s ease;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }

    .features-dots .fdot.active {
        width: 22px;
        border-radius: 4px;
        background: var(--gradient);
    }
}


/* How It Works section */
@media (max-width: 768px) {

    section {
        padding: 60px 1.2rem !important;
    }

    .section-header {
        margin-bottom: 2.5rem !important;
    }

    .section-header h2 {
        font-size: clamp(1.6rem, 6vw, 2rem) !important;
        line-height: 1.3;
    }

    .section-header p {
        font-size: 0.95rem !important;
    }

    .steps-container {
        flex-direction: column !important;
        align-items: center !important;
        gap: 40px !important;
        padding: 0 !important;
    }

    .step-item {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 280px !important;
    }

    .step-icon-wrapper {
        margin: 0 auto 16px !important;
        width: 72px !important;
        height: 72px !important;
    }

    .step-title {
        font-size: 1.15rem !important;
    }

    .step-desc {
        font-size: 0.9rem !important;
        max-width: 100% !important;
    }

    .steps-line,
    .step-connector {
        display: none !important;
    }
}


/* Testimonials */
@media (max-width: 768px) {

    .testimonials {
        padding: 60px 0 !important;
    }

    .testimonials .section-header {
        padding: 0 1.2rem;
    }

    .testimonials-grid {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        gap: 14px !important;
        padding: 10px 1.2rem 30px !important;
        margin: 0 -1.2rem !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .testimonials-grid::-webkit-scrollbar {
        display: none;
    }

    .testimonial-card {
        flex: 0 0 88% !important;
        width: auto !important;
        height: auto !important;
        min-width: 260px !important;
        scroll-snap-align: center;
    }

    .testimonial-card--featured {
        transform: none !important;
    }
}


/* Footer */
@media (max-width: 768px) {

    .site-footer {
        padding: 3rem 1.2rem 2rem !important;
        margin-top: 4rem !important;
        text-align: center !important;
    }

    .footer-container {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .footer-section {
        align-items: center !important;
        text-align: center !important;
    }

    .brand-info {
        grid-column: span 1 !important;
    }

    .contact-info a {
        justify-content: center !important;
    }

    .social-links {
        justify-content: center !important;
    }

    .footer-title::after {
        right: 50% !important;
        transform: translateX(50%) !important;
    }
}


/* Accessibility and Back to Top buttons */
@media (max-width: 768px) {

    /* Accessibility tool */
    .accessibility-container {
        bottom: 80px !important;
    }

    html[dir="rtl"] .accessibility-container {
        right: 1rem !important;
    }

    html[dir="ltr"] .accessibility-container {
        left: 1rem !important;
    }

    .access-toggle {
        width: 44px !important;
        height: 44px !important;
    }

    .access-menu {
        max-width: 88vw !important;
        min-width: 240px !important;
        padding: 1.2rem !important;
    }

    /* Back to Top button */
    .back-to-top {
        bottom: 84px !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1rem !important;
    }

    html[dir="rtl"] .back-to-top {
        left: 1rem !important;
        right: auto !important;
    }

    html[dir="ltr"] .back-to-top {
        right: 1rem !important;
        left: auto !important;
    }
}


/* Login page */
@media (max-width: 1024px) {

    body.login-page {
        height: auto !important;
        overflow: auto !important;
        overflow-x: hidden !important;
        min-height: 100svh;
    }

    body.login-page .login-section {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100svh !important;
        overflow: visible !important;
    }

    body.login-page .brand-section {
        display: none !important;
    }

    body.login-page .form-container {
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        padding: 80px 1.5rem 40px !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    body.login-page .form-container.active {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }
}

@media (max-width: 768px) {

    body.login-page .form-container {
        padding: 70px 1.25rem 40px !important;
    }

    .login-header h2 {
        font-size: 1.8rem !important;
    }

    .login-header p {
        font-size: 0.9rem !important;
    }

    .field-wrapper input,
    .field input {
    /* Flexible height */
        height: auto !important;
        min-height: 52px !important;
        padding-top: 0.85em !important;
        padding-bottom: 0.85em !important;
        border-radius: 12px !important;
        font-size: 1rem !important;

    /* Fixed side spacing that scales with icons */
    /* RTL: right icon 44px, left eye button 44px */
        padding-right: 2.8em !important;
        padding-left: 2.8em !important;
    }

    /* Main icon */
    .field-wrapper i.main-icon {
        font-size: 1rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    [dir="rtl"] .field-wrapper i.main-icon {
        right: 0.9em !important;
        left: auto !important;
    }

    [dir="ltr"] .field-wrapper i.main-icon {
        left: 0.9em !important;
        right: auto !important;
    }

    /* Eye button */
    .toggle-eye {
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    [dir="rtl"] .toggle-eye {
        left: 0.6em !important;
        right: auto !important;
    }

    [dir="ltr"] .toggle-eye {
        right: 0.6em !important;
        left: auto !important;
    }

    .role-switcher {
        border-radius: 12px !important;
        min-height: 50px !important;
    }

    .role-switcher button {
        padding: 10px 8px !important;
        font-size: 0.9rem !important;
        min-height: 46px !important;
    }

    .submit-btn {
        padding: 14px !important;
        font-size: 1rem !important;
        border-radius: 14px !important;
    }

    .footer-links {
        font-size: 0.9rem !important;
        margin-top: 25px !important;
    }

    /* /* */
    #userFields {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    #userFields .input-group {
        width: 100% !important;
        margin-bottom: 18px !important;
    }

    /* Label takes a full line and does not break */
    #userFields .input-group label {
        display: block !important;
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        margin-bottom: 8px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Field wrapper takes the full width */
    #userFields .field-wrapper {
        width: 100% !important;
    }

    #userFields .field-wrapper input {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    body.signup-page .grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    body.signup-page .grid .input-group {
        width: 100% !important;
        margin-bottom: 18px !important;
    }

    body.signup-page .full {
        grid-column: span 1 !important;
    }

    body.signup-page .grid .input-group label {
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        margin-bottom: 8px !important;
    }

    body.signup-page .grid .field input,
    body.signup-page .grid .field-wrapper input {
        width: 100% !important;
        box-sizing: border-box !important;
        height: auto !important;
        min-height: 52px !important;
        padding-top: 0.85em !important;
        padding-bottom: 0.85em !important;
        border-radius: 12px !important;
    }
}


/* Signup page */
@media (max-width: 1024px) {

    body.signup-page {
        height: auto !important;
        overflow: auto !important;
        overflow-x: hidden !important;
        flex-direction: column !important;
        min-height: 100svh;
        padding: 0 !important;
        align-items: stretch !important;
    }

    body.signup-page .brand-section {
        display: none !important;
    }

    body.signup-page .card {
        margin: 70px auto 30px !important;
        width: calc(100% - 2.4rem) !important;
        max-width: 480px !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: visible !important;
        padding: 24px 20px !important;
        border-radius: 20px !important;
    }
}

@media (max-width: 480px) {

    body.signup-page .card {
        width: calc(100% - 2rem) !important;
        margin: 65px auto 20px !important;
        padding: 20px 16px !important;
    }

    .stepper {
        margin-bottom: 30px !important;
    }

    .step {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    .step-label {
        font-size: 0.6rem !important;
        top: 38px !important;
    }
}


/* Very small phones below 390px */
@media (max-width: 390px) {

    .hero-content h1 {
        font-size: 1.75rem !important;
    }

    .main-cta-btn,
    .btn-secondary {
        font-size: 0.95rem !important;
    }

    .step-label {
        display: none !important;
    }

    .grid {
        grid-template-columns: 1fr !important;
    }

    .otp-inputs {
        gap: 6px !important;
    }

    .access-menu {
        max-width: 92vw !important;
        min-width: 220px !important;
    }
}


/* Touch UX improvements */
@media (max-width: 768px) {

    /* Touch target should not be less than 44px */
    .btn,
    .submit-btn,
    .btn-submit,
    .role-switcher button,
    .tab,
    .theme-toggle,
    .lang-toggle,
    .access-toggle,
    .back-to-top {
        min-height: 44px;
    }

    /* Prevent text selection on touch */
    button,
    .btn,
    .logo,
    nav a {
        -webkit-tap-highlight-color: transparent;
        -webkit-user-select: none;
        user-select: none;
    }

    /* Smooth scrolling */
    .carousel-container,
    .testimonials-grid {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Add scroll indicators to the carousel */
    .carousel-container::after,
    .testimonials-grid::after {
        content: '';
        flex: 0 0 1.2rem;
    }
}


/* Background canvas */
@media (max-width: 768px) {

    #bg-canvas {
    /* Keep it visible */
        display: block !important;
    /* Ensure it does not affect scrolling */
        pointer-events: none;
    }
}


/* Typography readability improvements */
@media (max-width: 768px) {

    p, li, span {
        line-height: 1.75;
    }

    .badge {
        font-size: 0.8rem !important;
        padding: 6px 16px !important;
    }

    /* Prevent images from stretching too much */
    img {
        max-width: 100%;
        height: auto;
    }
}


/* OTP page fix on mobile */
@media (max-width: 480px) {

    .otp-inputs {
        gap: 6px !important;
    }

    .otp-inputs input,
    .otp-inputs input.otp-box {
        height: 48px !important;
        font-size: 1.25rem !important;
        border-radius: 10px !important;
    }
}


/* Mobile landscape mode */
@media (max-width: 768px) and (orientation: landscape) {

    .hero {
        padding: 4.5rem 1.5rem 2rem !important;
    }

    body.login-page .form-container {
        padding: 55px 1.5rem 30px !important;
    }

    body.signup-page .card {
        margin-top: 55px !important;
    }
}

/* Password recovery page */
@media (max-width: 768px) {

    body.login-page .stepper {
        margin-bottom: clamp(30px, 2.5em, 60px) !important;
    }

    body.login-page .step {
    /* Circle size expands with font size */
        width: clamp(36px, 2.8em, 60px) !important;
        height: clamp(36px, 2.8em, 60px) !important;
        font-size: clamp(0.85rem, 1em, 1.3rem) !important;
        flex-shrink: 0;
    }

    body.login-page .step-label {
    /* Step label scale */
        font-size: clamp(0.65rem, 0.75em, 1rem) !important;
        top: clamp(40px, 3em, 70px) !important;
        white-space: nowrap;
    }

    body.login-page .login-header h2,
    body.login-page h3:not(.sr-only) {
        font-size: clamp(1.3rem, 1.8em, 2.4rem) !important;
        line-height: 1.3;
    }

    body.login-page .login-header p,
    body.login-page p:not(.sr-only) {
        font-size: clamp(0.85rem, 0.95em, 1.2rem) !important;
        line-height: 1.6;
    }

    body.login-page .form-container .field-wrapper input {
        height: auto !important;
        min-height: clamp(48px, 3.5em, 72px) !important;
        padding-top: 0.85em !important;
        padding-bottom: 0.85em !important;
        font-size: clamp(0.9rem, 1em, 1.2rem) !important;
    }

    body.login-page .form-container .submit-btn {
        min-height: clamp(48px, 3.2em, 72px) !important;
        font-size: clamp(0.95rem, 1em, 1.2rem) !important;
        padding: 0.85em 1em !important;
    }
}

/* Dashboard */
@media (max-width: 768px) {

    /* Wrapper takes full width without overflow */
    .dashboard-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        perspective: none !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    /* Main card */
    .main-card {
        padding: 1.1rem !important;
        border-radius: 1.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Card header */
    .card-header {
        flex-wrap: wrap !important;
        gap: 0.4rem !important;
        margin-bottom: 1rem !important;
        align-items: center !important;
    }

    .card-header h3 {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }

    .card-header p {
        font-size: 0.7rem !important;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem !important;
        margin-bottom: 1rem !important;
    }

    /* Stat cards */
    .stat-card {
        padding: 0.75rem !important;
        border-radius: 1rem !important;
    }

    /* Large value */
    .val {
        font-size: 1.1rem !important;
        margin: 0.25rem 0 !important;
    }

    /* Label */
    .stat-label {
        font-size: 0.7rem !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
    }

    .stat-label svg,
    .stat-label i {
        width: 12px !important;
        height: 12px !important;
        font-size: 0.7rem !important;
    }

    /* Sub text */
    .stat-sub {
        font-size: 0.65rem !important;
    }

    /* Usage chart */
    .usage-label {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }

    .chart-container {
        height: 70px !important;
        gap: 5px !important;
        padding: 8px !important;
        border-radius: 10px !important;
    }

    /* Alert box */
    .alert-box {
        padding: 0.7rem 0.9rem !important;
        font-size: 0.78rem !important;
        border-radius: 0.8rem !important;
        margin-top: 1rem !important;
        gap: 8px !important;
    }

    /* Green dot */
    .status-dot {
        width: 7px !important;
        height: 7px !important;
        flex-shrink: 0 !important;
    }
}

/* Very small phones below 390px */
@media (max-width: 390px) {

    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    .stat-card {
        padding: 0.65rem 0.85rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
    }

    .val {
        font-size: 1rem !important;
        margin: 0 !important;
    }

    .chart-container {
        height: 60px !important;
    }
}

/* FIX: Wide Page Mode for Login + Password Recovery */

body.login-page.wide-page {
    height: 100vh !important;
    overflow: hidden !important;
}

body.login-page.wide-page .login-section {
    display: flex !important;
    height: 100vh !important;
    min-height: 100vh !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    align-items: stretch !important;
}

body.login-page.wide-page .brand-section {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    height: 100vh !important;
    min-height: 100vh !important;
}

body.login-page.wide-page .form-container {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    padding: 40px 70px !important;
    margin: 0 !important;
    overflow-y: auto !important;
    align-self: stretch !important;
}

body.login-page.wide-page .form-container > * {
    max-width: 450px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.login-page.wide-page .form-container.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

html[dir="rtl"] body.login-page.wide-page .login-section {
    flex-direction: row-reverse !important;
}

html[dir="ltr"] body.login-page.wide-page .login-section {
    flex-direction: row-reverse !important;
}

@media (max-width: 1024px) {
    body.login-page.wide-page {
        height: auto !important;
        min-height: 100svh !important;
        overflow: auto !important;
    }

    body.login-page.wide-page .login-section {
        height: auto !important;
        min-height: 100svh !important;
        width: 100% !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    body.login-page.wide-page .brand-section {
        display: none !important;
    }

    body.login-page.wide-page .form-container {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        padding: 70px 1.25rem 40px !important;
        overflow-y: visible !important;
    }

    body.login-page.wide-page .form-container > * {
        max-width: 450px !important;
    }

    body.login-page.wide-page .form-container.active {
        justify-content: flex-start !important;
    }
}
/* FIX: Testimonial cards */
.testimonial-card {
    height: auto !important;
    min-height: 300px !important;
}

/* Ensure the featured card also expands */
.testimonial-card--featured {
    height: auto !important;
    min-height: 300px !important;
}

/* On mobile, cards are already auto height */
@media (max-width: 768px) {
    .testimonial-card {
        height: auto !important;
        min-height: unset !important;
    }
}

/* FIX: Feature cards */
.carousel-track {
    align-items: stretch !important;
}

.feature-card {
    height: auto !important;
    min-height: unset !important;
    display: flex !important;
    flex-direction: column !important;
}

.feature-card p {
    flex: 1 !important;
}

/* Testimonial cards */
.testimonials-grid {
    align-items: stretch !important;
}

.testimonial-card {
    height: auto !important;
    min-height: unset !important;
    display: flex !important;
    flex-direction: column !important;
}

.testimonial-card p {
    flex: 1 !important;
}

.testimonial-card .testi-card-bottom {
    margin-top: auto !important;
}