/* ============================================================
   Password Generator — Complete Stylesheet
   Supports both light (legacy layout) and dark theme
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0f0f1a;
    --bg-card: rgba(255,255,255,0.06);
    --bg-card-hover: rgba(255,255,255,0.09);
    --bg-input: rgba(255,255,255,0.08);
    --border: rgba(255,255,255,0.1);
    --border-focus: rgba(139,92,246,0.5);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-glow: rgba(139,92,246,0.3);
    --green: #10b981;
    --green-glow: rgba(16,185,129,0.3);
    --orange: #f59e0b;
    --red: #ef4444;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-card: 0 8px 32px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 30px rgba(139,92,246,0.15);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body {
    min-height: 100vh;
    background-color: #0f0f1a;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(139,92,246,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16,185,129,0.05) 0%, transparent 60%);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Animated background --- */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238b5cf6' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ============================================================
   UTILITY CLASSES (compatible with both old & new layouts)
   ============================================================ */

/* --- Display & Position --- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; top: 0; z-index: 100; }
.inset-0 { inset: 0; }
.z-50 { z-index: 50; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* --- Gaps & Spacing --- */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* --- Widths --- */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-56 { width: 14rem; }
.w-full { width: 100%; }

/* --- Heights --- */
.h-2 { height: 0.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }

/* --- Max Widths --- */
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-none { max-width: none; }
.max-h-80 { max-height: 20rem; }

/* --- Margins --- */
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mt-16 { margin-top: 4rem; }
.mt-20 { margin-top: 5rem; }
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-auto { margin-left: auto; }

/* --- Paddings --- */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pr-12 { padding-right: 3rem; }
.pb-4 { padding-bottom: 1rem; }

/* --- Text Align --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* --- Border Radius --- */
.rounded { border-radius: 0.25rem; }
.rounded-sm { border-radius: 0.125rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* --- Borders --- */
.border { border: 1px solid #e2e8f0; }
.border-t { border-top: 1px solid #e2e8f0; }
.border-b { border-bottom: 1px solid #e2e8f0; }
.border-gray-100 { border-color: #f1f5f9; }
.border-gray-200 { border-color: #e2e8f0; }
.border-gray-300 { border-color: #cbd5e1; }

/* --- Backgrounds --- */
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f8fafc; }
.bg-gray-100 { background-color: #f1f5f9; }
.bg-gray-200 { background-color: #e2e8f0; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-indigo-600 { background-color: #4f46e5; }
.bg-green-50 { background-color: #f0fdf4; }

/* --- Text Colors --- */
.text-white { color: #fff; }
.text-gray-300 { color: #cbd5e1; }
.text-gray-400 { color: #94a3b8; }
.text-gray-500 { color: #64748b; }
.text-gray-600 { color: #475569; }
.text-gray-700 { color: #334155; }
.text-gray-900 { color: #0f172a; }
.text-indigo-400 { color: #a78bfa; }
.text-indigo-500 { color: #8b5cf6; }
.text-indigo-600 { color: #4f46e5; }
.text-purple-400 { color: #c084fc; }
.text-green-400 { color: #34d399; }
.text-green-500 { color: #22c55e; }

/* --- Font Sizes --- */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

/* --- Font Weights --- */
.font-mono { font-family: 'SF Mono','Fira Code','JetBrains Mono','Roboto Mono',monospace; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.leading-relaxed { line-height: 1.625; }
.uppercase { text-transform: uppercase; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* --- Opacity --- */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* --- Shadows --- */
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }

/* --- Cursor & Outline --- */
.cursor-pointer { cursor: pointer; }
.outline-none { outline: none; }

/* --- Transforms --- */
.-translate-y-1\/2 { transform: translateY(-50%); }
.rotate-180 { transform: rotate(180deg); }
.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }

/* --- Transitions --- */
.transition { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-all { transition: all 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }
.transition-opacity { transition: opacity 0.2s ease; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }
.duration-1000 { transition-duration: 1000ms; }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }

/* --- Hover States --- */
.hover\:bg-gray-50:hover { background-color: #f8fafc; }
.hover\:bg-gray-100:hover { background-color: #f1f5f9; }
.hover\:bg-indigo-700:hover { background-color: #4338ca; }
.hover\:border-indigo-300:hover { border-color: #a5b4fc; }
.hover\:text-gray-700:hover { color: #334155; }
.hover\:text-indigo-600:hover { color: #4f46e5; }

/* --- Focus States --- */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(79,70,229,0.3); }
.focus\:ring-4:focus { box-shadow: 0 0 0 4px rgba(79,70,229,0.15); }
.focus\:ring-indigo-200:focus { box-shadow: 0 0 0 4px rgba(199,210,254,1); }
.focus\:ring-indigo-500:focus { box-shadow: 0 0 0 2px rgba(99,102,241,1); }
.focus\:border-indigo-500:focus { border-color: #6366f1; }

/* --- Active --- */
.active\:scale-95:active { transform: scale(0.95); }

/* --- Accent Color --- */
.accent-indigo-600 { accent-color: #4f46e5; }

/* ============================================================
   LEGACY COMPONENT STYLES (for old layout compatibility)
   ============================================================ */

/* Slider thumb (old class) */
.slider-thumb::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79,70,229,0.3);
    transition: transform 0.15s ease;
}
.slider-thumb::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-thumb::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(79,70,229,0.3);
}

/* Checkbox :has() checked (old layout) */
label:has(input:checked) { border-color: #4f46e5; background: #eef2ff; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* Dots animation */
@keyframes dots { 0%,20% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
.dot-1 { animation: dots 1.5s infinite 0s; }
.dot-2 { animation: dots 1.5s infinite 0.3s; }
.dot-3 { animation: dots 1.5s infinite 0.6s; }

/* Prose for ToS/Privacy */
.prose h2 { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.25rem; font-weight: 700; color: #0f172a; }
.prose p { margin-bottom: 1rem; }
.prose-gray { color: #334155; }

/* ============================================================
   NEW COMPONENT STYLES (dark theme)
   ============================================================ */

/* --- Glass Card --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}
.glass-card-lg {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    transition: box-shadow 0.5s ease;
}

/* --- Header --- */
.site-header {
    background: rgba(15,15,26,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* --- Buttons --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(139,92,246,0.35);
    white-space: nowrap;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(139,92,246,0.5);
    background: linear-gradient(135deg, #9b6dff, #8b5cf6);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-input); color: var(--text-primary); }

/* --- Input --- */
.input-dark {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'SF Mono','Fira Code','JetBrains Mono','Roboto Mono',monospace;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: all var(--transition);
}
.input-dark:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.input-dark::selection { background: rgba(139,92,246,0.4); }

/* --- Password Output + Copy Button --- */
.password-output-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
}
.password-output-wrapper .input-dark {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
}
.password-output-wrapper .btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0 1.25rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    min-width: fit-content;
}
.password-output-wrapper .btn-copy:hover { background: rgba(139,92,246,0.15); color: var(--accent); border-color: rgba(139,92,246,0.3); }
.password-output-wrapper .btn-copy.copied { background: rgba(16,185,129,0.15); color: var(--green); border-color: rgba(16,185,129,0.3); }

/* --- Strength Meter --- */
.strength-meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.06); overflow: hidden; }
.strength-meter-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s ease;
}
.strength-label { font-size: 0.8125rem; font-weight: 600; }

/* --- Range Input --- */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border: 3px solid #0f0f1a;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(139,92,246,0.5);
    transition: all var(--transition);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 0 20px rgba(139,92,246,0.7); }
input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border: 3px solid #0f0f1a;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(139,92,246,0.5);
}

/* --- Checkbox Cards --- */
.char-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}
.char-option:hover { border-color: rgba(139,92,246,0.3); background: rgba(139,92,246,0.06); }
.char-option:has(input:checked) { border-color: var(--accent); background: rgba(139,92,246,0.12); box-shadow: 0 0 20px rgba(139,92,246,0.1); }
.char-option input[type="checkbox"] { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); border-radius: 4px; cursor: pointer; flex-shrink: 0; }
.char-option .char-icon {
    width: 3.5rem; height: 2.5rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); font-weight: 700; font-size: 0.8125rem;
    flex-shrink: 0; background: rgba(139,92,246,0.15); color: var(--accent);
}
.char-option:has(input:checked) .char-icon { background: rgba(139,92,246,0.3); color: #c4b5fd; }

/* --- Toggle --- */
.toggle-label {
    display: flex; align-items: center; gap: 0.625rem; cursor: pointer;
    padding: 0.625rem 1rem;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
    transition: all var(--transition); user-select: none; font-size: 0.875rem;
    color: var(--text-secondary);   /* ← dòng mới thêm */
}
.toggle-label:hover { border-color: rgba(139,92,246,0.3); }
.toggle-label:has(input:checked) { border-color: var(--accent); background: rgba(139,92,246,0.1); }
.toggle-label input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; cursor: pointer; }

/* --- FAQ Accordion --- */
.faq-item {
    background: var(--bg-card);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: all var(--transition);
}
.faq-item:hover { border-color: rgba(255,255,255,0.15); }
.faq-trigger {
    width: 100%; padding: 1rem 1.25rem; display: flex;
    align-items: center; justify-content: space-between; gap: 1rem;
    background: transparent; color: var(--text-primary); border: none;
    cursor: pointer; font-size: 0.9375rem; font-weight: 500; text-align: left;
    transition: all var(--transition);
}
.faq-trigger:hover { color: #fff; }
.faq-content { padding: 0 1.25rem 1.25rem; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.7; }
.faq-chevron { transition: transform 0.3s ease; flex-shrink: 0; color: var(--text-muted); }
.faq-chevron.open { transform: rotate(180deg); }

/* --- Tip Card --- */
.tip-card {
    display: flex; align-items: flex-start; gap: 0.875rem; padding: 1rem 1.125rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: var(--radius);
    transition: all var(--transition);
}
.tip-card:hover { border-color: rgba(255,255,255,0.15); }
.tip-number {
    width: 2rem; height: 2rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(139,92,246,0.1));
    color: #c4b5fd; font-weight: 700; font-size: 0.8125rem; border-radius: var(--radius-sm);
}

/* --- Badge --- */
.badge {
    display: inline-flex; align-items: center; padding: 0.25rem 0.75rem;
    border-radius: 9999px; font-size: 0.75rem; font-weight: 600;
    background: rgba(139,92,246,0.15); color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.2);
}

/* --- Divider --- */
.divider { width: 100%; height: 1px; background: var(--border); }

/* --- Footer --- */
.site-footer {
    background: rgba(15,15,26,0.7);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* --- Nav Link --- */
.nav-link {
    font-size: 0.875rem; font-weight: 500; color: var(--text-secondary);
    text-decoration: none; transition: color var(--transition);
    padding: 0.375rem 0; cursor: pointer;
}
.nav-link:hover { color: #a78bfa; }
.no-underline { text-decoration: none !important; }

/* --- Language Switcher --- */
.lang-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input); color: var(--text-secondary);
    font-size: 0.8125rem; font-weight: 500;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: all var(--transition);
}
.lang-btn:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.2); color: var(--text-primary); }
.lang-flag { width: 1.25rem; height: 0.9375rem; border-radius: 2px; flex-shrink: 0; object-fit: cover; }
.lang-dropdown {
    position: absolute; right: 0; margin-top: 0.5rem; width: 14rem;
    background: rgba(20,20,35,0.98);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
    overflow: hidden; z-index: 200;
}
.lang-dropdown.mobile { right: auto; left: 0; bottom: 100%; margin-bottom: 0.5rem; margin-top: 0; }
.lang-item {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 1rem;
    font-size: 0.8125rem; color: var(--text-secondary);
    text-decoration: none; transition: all 0.15s ease;
}
.lang-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.lang-item.active { background: rgba(139,92,246,0.15); color: #c4b5fd; font-weight: 600; }
.lang-check { margin-left: auto; color: var(--accent); }

/* ============================================================
   Polyfills
   ============================================================ */
@supports not selector(:has(*)) {
    label input:checked ~ * { color: #4f46e5; }
}

/* ============================================================
   RTL Support
   ============================================================ */
[dir="rtl"] .space-x-2 > * + * { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .space-x-3 > * + * { margin-left: 0; margin-right: 0.75rem; }
[dir="rtl"] .space-x-4 > * + * { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .space-x-6 > * + * { margin-left: 0; margin-right: 1.5rem; }
[dir="rtl"] .ml-auto { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pr-12 { padding-right: 0.75rem; padding-left: 3rem; }
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .btn-copy { border-radius: var(--radius) 0 0 var(--radius); border-left: 1px solid var(--border); border-right: none; }
[dir="rtl"] .input-dark { border-radius: 0 var(--radius) var(--radius) 0; border-right: 1px solid var(--border); border-left: none; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .lang-dropdown.mobile { left: auto; right: 0; }
[dir="rtl"] .lang-check { margin-left: 0; margin-right: auto; }

/* ============================================================
   Responsive (Tailwind breakpoints: sm=640, md=768, lg=1024)
   ============================================================ */

/* sm: 640px+ */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .sm\:p-8 { padding: 2rem; }
    .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .sm\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .sm\:text-5xl { font-size: 3rem; line-height: 1; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm\:inline { display: inline; }
    .sm\:hidden { display: none; }
    .sm\:w-auto { width: auto; }
}

/* md: 768px+ */
@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:flex-row { flex-direction: row; }
}

/* lg: 1024px+ */
@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:py-20 { padding-top: 5rem; padding-bottom: 5rem; }
    .lg\:text-5xl { font-size: 3rem; line-height: 1; }
    .lg\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
}

/* Mobile-only (<640px) */
@media (max-width: 639px) {
    .password-output-wrapper { flex-direction: column; }
    .password-output-wrapper .input-dark { border-radius: var(--radius) var(--radius) 0 0; border-right: 1px solid var(--border); }
    .password-output-wrapper .btn-copy { border-radius: 0 0 var(--radius) var(--radius); border: 1px solid var(--border); border-top: none; padding: 0.75rem; }
    [dir="rtl"] .password-output-wrapper .input-dark { border-radius: var(--radius) var(--radius) 0 0; border-left: 1px solid var(--border); }
    [dir="rtl"] .password-output-wrapper .btn-copy { border-radius: 0 0 var(--radius) var(--radius); }
    .btn-primary.btn-mobile-full { width: 100%; justify-content: center; }
    .mobile-stack { flex-direction: column !important; align-items: stretch !important; }
    .mobile-stack > .btn-primary { width: 100%; justify-content: center; }
}

/* Print */
@media print {
    header, footer, nav, .settings, button { display: none !important; }
    body { background: white; color: black; }
    body::before { display: none; }
    .password-output { border: 2px solid #000; font-size: 24pt; }
}

/* Favicon (inline as fallback) */
link[rel="icon"] { display: none; }
