:root {
            --bg: #f8f9fa;
            --card: #ffffff;
            --text: #1a1a1a;
            --border: #e2e8f0;
            --input-bg: #f8fafc;
            --primary: #3b82f6;
            --primary-hover: #2563eb;
            --success: #10b981;
            --success-hover: #059669;
        }


        @media (prefers-color-scheme: dark) {
            :root {
                --bg: #0f172a;
                --card: #1e293b;
                --text: #f8fafc;
                --border: #334155;
                --input-bg: #0f172a;
                --primary: #3b82f6;
            }
        }


        body { 
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            max-width: 650px; 
            margin: 40px auto; 
            padding: 20px; 
            background: var(--bg); 
            color: var(--text);
            line-height: 1.6; 
        }


        .card { 
            background: var(--card);
            border-radius: 16px; 
            padding: 30px; 
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            border: 1px solid var(--border);
            margin-bottom: 25px;
        }


        h1 {
            text-align: center;
            font-size: 2rem;
            margin-bottom: 5px;
        }


        .subtitle {
            text-align: center;
            opacity: 0.8;
            margin-bottom: 30px;
            font-size: 0.95rem;
        }


        label {
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 8px;
            display: block;
        }


        input[type="password"], input[type="text"], input[type="file"], textarea { 
            width: 100%;
            padding: 12px 16px; 
            margin-bottom: 10px; 
            border: 2px solid var(--border); 
            border-radius: 10px; 
            font-size: 16px; 
            box-sizing: border-box; 
            background: var(--input-bg);
            color: var(--text);
            transition: border-color 0.2s;
        }


        input:focus, textarea:focus {
            outline: none;
            border-color: var(--primary);
        }


        textarea { 
            min-height: 150px;
            resize: vertical;
            margin-bottom: 20px;
        }


        /* Checkbox Styling */
        .checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: normal;
            font-size: 0.95rem;
            cursor: pointer;
            margin-bottom: 20px;
            color: var(--text);
            opacity: 0.9;
        }
        
        .checkbox-label input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin: 0;
            cursor: pointer;
        }


        /* Password Strength & Generator */
        .strength-bar { 
            height: 4px; 
            background: var(--border); 
            border-radius: 2px; 
            margin: 5px 0 15px 0; 
            overflow: hidden; 
        }
        .strength-fill { 
            height: 100%; 
            width: 0; 
            transition: width 0.3s ease, background-color 0.3s ease; 
        }
        
        .generator-row {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
            align-items: center;
        }


        .btn-secondary {
            background: transparent;
            color: var(--primary);
            border: 2px solid var(--primary);
            padding: 10px 12px;
            font-size: 14px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s;
        }
        .btn-secondary:hover {
            background: rgba(59, 130, 246, 0.1);
        }
        
        input[type="number"].length-input {
            margin-bottom: 0;
            padding: 10px 12px;
            width: 70px;
            border: 2px solid var(--border);
            border-radius: 8px;
            font-size: 14px;
            font-weight: bold;
            background: var(--input-bg);
            color: var(--text);
            text-align: center;
        }


        .btn-center {
            display: flex;
            justify-content: center;
        }


        button.action-btn { 
            width: 100%;
            max-width: 350px;
            padding: 14px 20px;
            font-size: 16px; 
            border: none; 
            border-radius: 10px; 
            cursor: pointer; 
            font-weight: bold;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }


        .btn-primary { background: var(--primary); color: white; }
        .btn-primary:hover { background: var(--primary-hover); }
        .btn-success { background: var(--success); color: white; }
        .btn-success:hover { background: var(--success-hover); }


        /* Guide / FAQ Section */
        .guide-section h3 {
            margin-top: 0;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .guide-section ol {
            padding-left: 20px;
            margin-bottom: 20px;
        }
        .guide-section li {
            margin-bottom: 10px;
            opacity: 0.9;
            font-size: 0.95rem;
        }
        .guide-section .highlight {
            background: rgba(59, 130, 246, 0.1);
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid var(--primary);
            font-size: 0.95rem;
        }


        /* Loader */
        #loader-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.75); color: white; z-index: 9999;
            display: none;
            flex-direction: column; align-items: center; justify-content: center;
            backdrop-filter: blur(4px);
        }
        .spinner {
            border: 4px solid rgba(255, 255, 255, 0.2);
            border-top: 4px solid var(--primary);
            border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite;
            margin-bottom: 15px;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* CSP-safe replacements for removed inline styles */
.loader-title {
    margin: 0;
    font-size: 1.2rem;
}

.inline-note {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.8;
    color: var(--text);
}

.file-input {
    margin-bottom: 20px;
}

.small-muted {
    font-size: 0.85em;
    opacity: 0.8;
}

/* Mobile polish */
@media (max-width: 520px) {
    body {
        margin: 24px auto;
        padding: 16px;
    }

    .card {
        padding: 24px;
    }

    h1 {
        font-size: 2rem;
    }

    .generator-row {
        flex-wrap: wrap;
    }

    .btn-secondary {
        flex: 1 1 180px;
        min-height: 44px;
    }

    input[type="number"].length-input {
        width: 76px;
        min-height: 44px;
    }

    button.action-btn {
        max-width: 100%;
    }
}

/* Normalize Samsung/Android form controls a bit */
button {
    appearance: none;
    -webkit-appearance: none;
}
