*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #e2e8f0;
    background: #0a0a1a;
    overflow-x: hidden;
}

.bg-animated { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-gradient {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
}

.app-container {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 24px;
}

.glass-card {
    background: rgba(15, 15, 35, 0.75);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 80px rgba(139, 92, 246, 0.06);
}

.app-card { width: 100%; max-width: 480px; padding: 32px; }

.app-header { text-align: center; margin-bottom: 24px; }
.app-icon { font-size: 36px; color: #8b5cf6; margin-bottom: 12px; }
.app-title { font-size: 22px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.app-subtitle { font-size: 13px; color: #94a3b8; }

/* ===== Password Display ===== */
.password-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.password-text {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    color: #e2e8f0;
    word-break: break-all;
    line-height: 1.5;
    -webkit-user-select: all;
    user-select: all;
}

.btn-copy {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: #a78bfa;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-copy:hover { background: rgba(139, 92, 246, 0.3); color: #fff; }

/* ===== Strength Meter ===== */
.strength-meter {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}

.strength-bar {
    flex: 1; height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-label {
    font-size: 12px;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

/* ===== Options ===== */
.option-group { margin-bottom: 18px; }

.option-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}

.input-label {
    font-size: 12px; font-weight: 600; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.length-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px; font-weight: 700; color: #a78bfa;
}

/* Range Slider */
.range-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.range-slider::-moz-range-thumb {
    width: 20px; height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* Checkbox Options */
.char-options {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 20px;
}

.checkbox-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-option:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
}

.checkbox-option input[type="checkbox"] { display: none; }

.checkmark {
    width: 20px; height: 20px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.checkbox-option input:checked ~ .checkmark {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: #8b5cf6;
}

.checkbox-option input:checked ~ .checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.option-text { flex: 1; font-size: 14px; color: #e2e8f0; }

.option-sample {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== Generate Button ===== */
.btn-generate {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(139, 92, 246, 0.45); }

/* ===== Overlay & Source Viewer ===== */
.overlay-panel { position: fixed; bottom: 24px; right: 24px; z-index: 1000; background: rgba(15, 15, 35, 0.85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border: 1px solid rgba(139, 92, 246, 0.25); border-radius: 16px; padding: 20px; min-width: 260px; max-width: 320px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 60px rgba(139, 92, 246, 0.1); font-family: 'Inter', 'Segoe UI', sans-serif; color: #e2e8f0; transition: transform 0.3s ease, opacity 0.3s ease; }
.overlay-panel.collapsed { transform: translateY(calc(100% - 48px)); }
.overlay-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.overlay-title { font-size: 15px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; }
.overlay-title .icon-3d { color: #8b5cf6; font-size: 18px; }
.overlay-toggle { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 8px; color: #a78bfa; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; font-size: 12px; }
.overlay-toggle:hover { background: rgba(139, 92, 246, 0.3); }
.overlay-body { display: flex; flex-direction: column; gap: 10px; }
.overlay-desc { font-size: 12px; color: #94a3b8; line-height: 1.5; }
.overlay-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all 0.3s ease; border: none; font-family: inherit; }
.btn-back { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); color: #94a3b8; }
.btn-back:hover { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; transform: translateX(-2px); }
.btn-source { background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-source:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(139, 92, 246, 0.45); }
.open-source-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; color: #34d399; background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3); }
.overlay-desc .accent-text { color: #a78bfa; }

.source-viewer { position: fixed; inset: 0; z-index: 3000; background: rgba(10, 10, 26, 0.98); display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.source-viewer.active { opacity: 1; visibility: visible; }
.source-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: rgba(15, 15, 35, 0.95); border-bottom: 1px solid rgba(139, 92, 246, 0.2); }
.source-header-left { display: flex; align-items: center; gap: 12px; }
.source-filename { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: #a78bfa; font-weight: 600; }
.source-badge { background: rgba(52, 211, 153, 0.15); border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 6px; padding: 2px 8px; font-size: 11px; color: #34d399; font-weight: 600; }
.source-header-right { display: flex; align-items: center; gap: 8px; }
.btn-copy-source, .btn-close-source { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; color: #94a3b8; padding: 8px 14px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 6px; font-family: inherit; }
.btn-copy-source:hover, .btn-close-source:hover { background: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
.source-body { flex: 1; overflow: auto; padding: 0; }
.source-body pre { margin: 0; padding: 24px; font-size: 13px; line-height: 1.6; }
.source-body code { font-family: 'JetBrains Mono', monospace; }

@media (max-width: 600px) {
    .app-card { padding: 20px; }
    .password-text { font-size: 14px; }
    .overlay-panel { bottom: 12px; right: 12px; left: 12px; min-width: unset; max-width: unset; }
    .source-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .source-body pre { padding: 16px; font-size: 11px; }
}
