        /* --- style.css --- */
        /* Main Stylesheet - Village Tech Hub */
        :root {
            --primary: #d32f2f;
            --primary-dark: #b71c1c;
            --secondary: #7f1d1d;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --info: #3b82f6;
            --text-color: #1f2937;
            --text-secondary: #4b5563;
            --bg-gradient: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
            --card-bg: rgba(255, 255, 255, 0.92);
            --card-border: rgba(15, 23, 42, 0.12);
            --shadow: rgba(15, 23, 42, 0.12);

            /* Surface + control tokens. The page renders on a white ground,
               so controls are light by default; older rules that still used
               the pre-light-theme dark values now read from these. */
            --surface: #ffffff;
            --surface-muted: #f1f5f9;
            --field-bg: #ffffff;
            --field-border: rgba(15, 23, 42, 0.18);
            --focus-ring: rgba(211, 47, 47, 0.15);
        }

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

        html,
        body {
            font-family: 'Poppins', sans-serif;
            color: var(--text-color);
            min-height: 100vh;
            line-height: 1.6;
            overflow-x: hidden;
            /* clip hides sideways overflow like hidden, but doesn't turn body into
               a scroll container, so position: sticky (nav bar, dashboard rail)
               works. Browsers without clip keep the hidden fallback above. */
            overflow-x: clip;
        }

        /* The white ground lives on <html>; body stays transparent so the
           watermark below (a z-index:-1 pseudo-element) is not painted over
           by body's own background box. */
        html {
            background: #ffffff;
        }

        body {
            background: transparent;
        }

        /* Village Tech pattern watermark.
           Painted on a fixed pseudo-element rather than the body itself:
           background-attachment: fixed is janky (and sometimes ignored) on
           iOS Safari, and a scrolling `cover` would stretch the motif down
           the full height of a long page. This always matches the viewport,
           on every device, and sits behind all content. */
        body::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: -1;
            background-image: url('../images/VT-1background-1024.png');
            background-position: center center;
            background-size: cover;
            background-repeat: no-repeat;
            pointer-events: none;
        }

        /* Light/dark color-scheme and OS high-contrast handling now live in
           design-system.css. The previous forced-light overrides were removed
           so the device theme and the user's theme choice are respected. */

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            position: relative;
            z-index: 1;
        }

        /* Glassmorphism Effect */
        .glass-effect {
            background: var(--card-bg);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--card-border);
            border-radius: 16px;
            box-shadow: 0 8px 32px 0 var(--shadow);
        }

        /* Navigation */
        .navbar {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            padding: 1rem 0;
            position: sticky;
            top: 0;
            z-index: 1000;
            border-bottom: 1px solid rgba(15, 23, 42, 0.08);
            position: relative;
        }

        .nav-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .nav-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-color);
        }

        .nav-brand i {
            font-size: 2rem;
            color: var(--primary);
        }

        .nav-menu {
            display: flex;
            list-style: none;
            gap: 1.5rem;
            align-items: center;
        }

        .nav-menu a {
            color: var(--text-color);
            text-decoration: none;
            transition: all 0.3s ease;
            padding: 0.5rem 1rem;
            border-radius: 8px;
        }

        .nav-menu a:hover {
            background: rgba(15, 23, 42, 0.06);
            transform: translateY(-2px);
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0.5rem 1rem;
            background: rgba(15, 23, 42, 0.06);
            border-radius: 8px;
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-decoration: none;
            font-family: 'Poppins', sans-serif;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(211, 47, 47, 0.35);
        }

        .btn-outline {
            background: transparent;
            border: 2px solid rgba(15, 23, 42, 0.2);
            color: var(--text-color);
        }

        .btn-outline:hover {
            background: rgba(15, 23, 42, 0.06);
            border-color: rgba(15, 23, 42, 0.32);
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-success {
            background: var(--success);
            color: white;
        }

        .btn-info {
            background: var(--info);
            color: white;
        }

        .btn-large {
            padding: 1rem 2rem;
            font-size: 1.1rem;
        }

        .btn-full {
            width: 100%;
            justify-content: center;
        }

        .btn-sm {
            padding: 0.5rem 1rem;
            font-size: 0.9rem;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Flash Messages */
        .flash-container {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .flash {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 1rem 1.5rem;
            border-radius: 12px;
            backdrop-filter: blur(10px);
            animation: slideIn 0.3s ease;
            min-width: 300px;
        }

        .flash-success {
            background: rgba(16, 185, 129, 0.9);
            border: 1px solid rgba(16, 185, 129, 1);
        }

        .flash-error {
            background: rgba(239, 68, 68, 0.9);
            border: 1px solid rgba(239, 68, 68, 1);
        }

        .flash-close {
            background: transparent;
            border: none;
            color: white;
            cursor: pointer;
            margin-left: auto;
            font-size: 1.2rem;
        }

        /* Hero Section */
        .hero {
            position: relative;
            min-height: 85vh;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            overflow: hidden;
        }

        .particles {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: rgba(255, 255, 255, 0.5);
            border-radius: 50%;
            animation: float 20s infinite;
        }

        .hero-content {
            position: relative;
            z-index: 1;
        }

        .hero-title {
            font-size: 4rem;
            font-weight: 700;
            margin-bottom: 1rem;
            background: linear-gradient(to right, #111827, #374151);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .hero-title i {
            color: var(--primary);
            -webkit-text-fill-color: var(--primary);
        }

        .hero-subtitle {
            font-size: 1.5rem;
            margin-bottom: 2rem;
            color: var(--text-secondary);
        }

        .hero-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
        }

        /* Features Section */
        .features {
            padding: 80px 0;
        }

        .section-title {
            text-align: center;
            font-size: 2.5rem;
            margin-bottom: 3rem;
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }

        .feature-card {
            padding: 2rem;
            text-align: center;
            transition: transform 0.3s ease;
        }

        .feature-card:hover {
            transform: translateY(-10px);
        }

        .feature-icon {
            font-size: 3rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .feature-card h3 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
        }

        /* CTA Section */
        .cta-section {
            padding: 80px 0;
        }

        .cta-card {
            text-align: center;
            padding: 4rem 2rem;
        }

        .cta-card h2 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
        }

        .cta-card p {
            font-size: 1.2rem;
            margin-bottom: 2rem;
            color: var(--text-secondary);
        }

        /* Auth Pages */
        .auth-section {
            min-height: calc(100vh - 80px);
            display: flex;
            align-items: center;
            padding: 2rem 0;
        }

        .auth-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            max-width: 900px;
            margin: 0 auto;
        }

        .auth-card {
            padding: 3rem;
        }

        .auth-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .auth-header i {
            font-size: 3rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }

        .auth-header h2 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .auth-form {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .form-group label {
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .form-group input,
        .form-group textarea,
        .form-group select {
            padding: 0.75rem 1rem;
            border: 1px solid var(--field-border);
            border-radius: 8px;
            background: var(--field-bg);
            color: var(--text-color);
            font-size: 1rem;
            font-family: 'Poppins', sans-serif;
            transition: all 0.3s ease;
        }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            background: var(--field-bg);
            box-shadow: 0 0 0 3px var(--focus-ring);
        }

        .form-hint {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .password-strength {
            height: 4px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
            overflow: hidden;
        }

        .strength-bar {
            height: 100%;
            width: 0%;
            transition: all 0.3s ease;
        }

        .strength-bar.weak {
            background: var(--danger);
        }

        .strength-bar.medium {
            background: var(--warning);
        }

        .strength-bar.good {
            background: var(--info);
        }

        .strength-bar.strong {
            background: var(--success);
        }

        .auth-footer {
            text-align: center;
            margin-top: 1.5rem;
        }

        .auth-footer a {
            color: var(--primary);
            font-weight: 600;
            text-decoration: none;
        }

        .info-card {
            padding: 2rem;
        }

        .info-card h3 {
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .demo-account {
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--surface-muted);
            border: 1px solid var(--card-border);
            border-radius: 8px;
        }

        .demo-account h4 {
            margin-bottom: 0.5rem;
            color: var(--primary);
        }

        /* Dashboard */
        .dashboard-section {
            padding: 2rem 0;
            min-height: calc(100vh - 80px);
        }

        .dashboard-header {
            text-align: center;
            margin-bottom: 3rem;
        }

        .dashboard-header h1 {
            font-size: 2.5rem;
            margin-bottom: 0.5rem;
        }

        .polls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 2rem;
        }

        .poll-card {
            padding: 2rem;
            transition: transform 0.3s ease;
        }

        .poll-card:hover {
            transform: translateY(-5px);
        }

        .poll-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1rem;
        }

        .poll-card-header h3 {
            font-size: 1.3rem;
            flex: 1;
        }

        .badge {
            padding: 0.4rem 0.8rem;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 600;
            white-space: nowrap;
        }

        .badge-primary {
            background: var(--primary);
        }

        .badge-success {
            background: var(--success);
        }

        .badge-secondary {
            background: var(--surface-muted);
            color: var(--text-secondary);
        }

        .poll-description {
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
        }

        .poll-stats {
            display: flex;
            gap: 2rem;
            margin-bottom: 1.5rem;
        }

        .stat {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
        }

        .empty-state i {
            font-size: 4rem;
            color: var(--primary);
            margin-bottom: 1rem;
        }

        /* Footer */
        .footer {
            text-align: center;
            padding: 2rem 0;
            margin-top: 4rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-secondary);
        }

        .footer i {
            color: var(--danger);
        }

        /* Ensure footer container is visible and sits above other elements when needed */
        .footer-container {
            background: var(--card-bg, rgba(0, 0, 0, 0.04));
            position: relative;
            z-index: 20;
        }

        .footer-content {
            max-width: 1000px;
            margin: 0 auto;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .nav-container {
                position: relative;
            }

            .user-info {
                background: rgba(255, 255, 255, 0.05);
                width: 100%;
                justify-content: flex-start;
                padding: 0.75rem 1rem;
            }

            .theme-toggle {
                width: 100%;
                justify-content: flex-start;
                padding: 0.75rem 1rem;
                border-radius: 8px;
                background: rgba(255, 255, 255, 0.05);
                border: none;
            }

            .theme-toggle i {
                margin-right: 10px;
            }

            .theme-toggle::after {
                content: "Toggle Theme";
            }

            /* Typography */
            .hero-title {
                font-size: 2.2rem;
            }

            .hero-subtitle {
                font-size: 1.1rem;
            }

            .section-title {
                font-size: 2rem;
            }

            .dashboard-header h1 {
                font-size: 2rem;
            }

            /* Layouts */
            .hero-buttons {
                flex-direction: column;
                width: 100%;
            }

            /* Override any display:flex overrides applied to btn inner styling if they conflict */
            .hero-buttons .btn {
                width: 100%;
                justify-content: center;
            }

            .auth-container {
                grid-template-columns: 1fr;
                padding: 0 15px;
                /* Add some margin from screen edge */
            }

            .auth-card {
                padding: 2rem 1.5rem;
                /* Reduce padding slightly */
            }

            .auth-info {
                display: none;
            }

            .polls-grid {
                grid-template-columns: 1fr;
                gap: 1.5rem;
            }

            .features-grid {
                grid-template-columns: 1fr;
                gap: 1.5rem;
            }

            .poll-stats {
                flex-direction: column;
                gap: 0.5rem;
            }
        }

        /* ========================================================================= */
        /* EOM SYSTEM UPGRADES - MOBILE FIRST UI COMPONENTS                          */
        /* ========================================================================= */

        /* Large touch targets */
        input[type="text"],
        input[type="password"],
        select,
        textarea {
            font-size: 16px !important;
            /* Prevents iOS zoom */
            padding: 12px 16px;
            height: 50px;
        }

        textarea {
            height: auto;
            min-height: 100px;
        }

        /* Segmented Controls for Rating */
        .segmented-control {
            display: flex;
            width: 100%;
            background: var(--surface-muted);
            border: 1px solid var(--card-border);
            border-radius: 12px;
            padding: 4px;
            gap: 4px;
        }

        .segmented-label {
            flex: 1;
            text-align: center;
            position: relative;
        }

        .segmented-label input[type="radio"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .segmented-button {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 10px 5px;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid transparent;
        }

        .segmented-label input[type="radio"]:checked+.segmented-button {
            background: var(--primary);
            border-color: rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
        }

        .seg-val {
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 2px;
        }

        .seg-text {
            font-size: 0.7rem;
            color: rgba(255, 255, 255, 0.7);
        }

        .segmented-label input[type="radio"]:checked+.segmented-button .seg-text {
            color: #fff;
        }

        /* Mobile Action Bar (Sticky Bottom) */
        .mobile-action-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(15px);
            border-top: 1px solid var(--card-border);
            padding: 15px 20px;
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
        }

        /* Ensure the body or main sections have padding-bottom so content isn't hidden by the action bar */
        .pb-80 {
            padding-bottom: 90px !important;
        }

        /* Searchable List Cards */
        .candidate-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 15px;
        }

        .candidate-item {
            display: flex;
            align-items: center;
            background: var(--surface);
            border: 1px solid var(--card-border);
            border-radius: 12px;
            padding: 15px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .candidate-item.selected {
            background: rgba(211, 47, 47, 0.2);
            border-color: var(--primary);
        }

        .candidate-item-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            margin-right: 15px;
        }

        .candidate-item-info {
            flex: 1;
        }

        .candidate-item-name {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 2px;
        }

        .candidate-item-code {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .candidate-item-check {
            color: var(--success);
            font-size: 1.5rem;
            opacity: 0;
            transform: scale(0.5);
            transition: all 0.2s ease;
        }

        .candidate-item.selected .candidate-item-check {
            opacity: 1;
            transform: scale(1);
        }

        /* Steps UI */
        .step-container {
            display: none;
            animation: fadeIn 0.3s ease;
        }

        .step-container.active {
            display: block;
        }

        .step-indicator {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
            position: relative;
            padding: 0 10px;
        }

        .step-indicator::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 20px;
            right: 20px;
            height: 2px;
            background: rgba(255, 255, 255, 0.1);
            z-index: 1;
            transform: translateY(-50%);
        }

        .step-dot {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: var(--surface-muted);
            border: 2px solid var(--card-border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.9rem;
            position: relative;
            z-index: 2;
            color: rgba(255, 255, 255, 0.5);
            transition: all 0.3s ease;
        }

        .step-dot.active {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
            box-shadow: 0 0 10px var(--primary);
        }

        .step-dot.completed {
            background: var(--success);
            border-color: var(--success);
            color: #fff;
        }

        /* Remove heavy glass effects on mobile for performance/readability.
           Opaque, but the same light surface as desktop — the previous dark
           value predated the light theme and left cards unreadable on phones. */
        @media (max-width: 768px) {
            .glass-effect {
                background: var(--surface);
                backdrop-filter: none;
                -webkit-backdrop-filter: none;
                border: 1px solid var(--card-border);
            }
        }

        /* Custom Password Toggle */
        .password-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        .password-toggle {
            position: absolute;
            right: 15px;
            background: none;
            border: none;
            color: #aaa;
            font-size: 1.2rem;
            cursor: pointer;
            padding: 0;
        }

        .password-toggle:focus {
            outline: none;
        }

