:root {
    /* Colors */
    --bg-main: #050505;
    --glass-bg: rgba(20, 20, 20, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #FFFFFF;
    --text-secondary: #8b949e;
    
    /* Security Accents (Green/Purple) */
    --accent: #10B981; /* Emerald */
    --accent-glow: rgba(16, 185, 129, 0.4);
    --accent-secondary: #8B5CF6; /* Violet */

    --surface: #161b22;
    --input-bg: rgba(0,0,0,0.3);
    
    --font-heading: 'Unbounded', sans-serif;
    --font-body: 'Inter', sans-serif;
    --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex; justify-content: center;
    overflow-x: hidden;
}

/* Background */
.ambient-bg { position: fixed; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.3; }
.orb-1 { top: -20%; left: -10%; width: 60vw; height: 60vw; background: radial-gradient(circle, var(--accent) 0%, transparent 60%); }
.orb-2 { bottom: -20%; right: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 60%); }

.layout {
    width: 100%; max-width: 500px; padding: 20px;
    display: flex; flex-direction: column; gap: 24px; z-index: 10;
}

/* HEADER */
.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; background: var(--glass-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 20px;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.back-btn {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05); border-radius: 10px; color: var(--text-secondary);
    transition: 0.2s; text-decoration: none;
}
.back-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

.brand { display: flex; align-items: center; gap: 10px; }
.logo-mark {
    width: 32px; height: 32px; background: linear-gradient(135deg, var(--accent), #059669);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow); color: white; font-size: 14px;
}
.logo-text { font-family: var(--font-heading); font-size: 16px; font-weight: 700; letter-spacing: -0.5px; }
.logo-text span { color: var(--accent); }

.badge-secure {
    font-size: 11px; font-weight: 600; color: var(--accent);
    background: rgba(16, 185, 129, 0.1); padding: 6px 12px; border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2); display: flex; align-items: center; gap: 6px;
}

/* MAIN CARD */
.pass-card {
    background: var(--glass-bg); border-radius: 24px; padding: 24px;
    border: 1px solid var(--glass-border); backdrop-filter: blur(20px);
}

/* RESULT AREA */
.result-area { margin-bottom: 24px; }
.password-box {
    background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
    border-radius: 16px; padding: 12px; display: flex; align-items: center;
    margin-bottom: 12px; transition: 0.3s; position: relative; overflow: hidden;
}
.password-box:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }

#password {
    flex: 1; background: transparent; border: none; font-family: 'JetBrains Mono', monospace;
    font-size: 18px; color: var(--text-primary); width: 100%; font-weight: 500; letter-spacing: 1px;
}

.action-buttons { display: flex; gap: 8px; }
.icon-btn {
    width: 36px; height: 36px; border-radius: 8px; border: none; background: rgba(255,255,255,0.05);
    color: var(--text-secondary); cursor: pointer; transition: 0.2s; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.icon-btn.copy:hover { color: var(--accent); background: rgba(16, 185, 129, 0.1); }

/* Strength Bar */
.strength-wrapper { display: flex; align-items: center; gap: 12px; }
.strength-bar-bg {
    flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden;
}
.strength-bar {
    height: 100%; width: 0%; border-radius: 3px; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.strength-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); width: 80px; text-align: right; }

/* SETTINGS */
.settings-grid { display: flex; flex-direction: column; gap: 24px; margin-bottom: 30px; }

/* SLIDER */
.setting-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.setting-header label { font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; }
#length-val { font-family: var(--font-heading); font-size: 16px; font-weight: 700; color: var(--accent); }

input[type=range] {
    -webkit-appearance: none; width: 100%; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%;
    background: var(--accent); margin-top: -7px; box-shadow: 0 0 10px var(--accent-glow);
    transition: 0.2s;
}
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.1); }

/* TOGGLES CARDS */
.toggles-container { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle-card { position: relative; cursor: pointer; }
.toggle-card input { position: absolute; opacity: 0; }
.toggle-content {
    background: var(--surface); border: 1px solid var(--glass-border);
    border-radius: 14px; padding: 12px; display: flex; flex-direction: column;
    align-items: center; gap: 6px; transition: 0.2s;
}
.toggle-content .char-preview { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--text-secondary); }
.toggle-content .name { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.toggle-card input:checked + .toggle-content {
    background: rgba(16, 185, 129, 0.1); border-color: var(--accent);
}
.toggle-card input:checked + .toggle-content .char-preview { color: var(--text-primary); }
.toggle-card input:checked + .toggle-content .name { color: var(--accent); }

/* ADVANCED */
.advanced-options {
    background: var(--surface); border-radius: 16px; padding: 16px; border: 1px solid var(--glass-border);
}
.switch-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.switch-label { display: flex; justify-content: space-between; width: 100%; cursor: pointer; align-items: center; }
.switch-text span { font-size: 13px; font-weight: 600; display: block; color: var(--text-primary); }
.switch-text small { font-size: 11px; color: var(--text-secondary); }

/* iOS Switch */
.switch-control { position: relative; width: 44px; height: 24px; }
.switch-control input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 2px; bottom: 2px;
    background-color: white; transition: .4s; border-radius: 50%;
}
.switch-control input:checked + .slider { background-color: var(--accent); }
.switch-control input:checked + .slider:before { transform: translateX(20px); }

.input-row label { display: block; font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; }
.input-row input {
    width: 100%; background: var(--bg-main); border: 1px solid var(--glass-border);
    padding: 10px; border-radius: 10px; color: var(--text-primary); font-family: inherit;
    transition: 0.2s;
}
.input-row input:focus { border-color: var(--accent); }

/* MAIN BUTTON */
.btn-generate {
    width: 100%; padding: 16px; border: none; border-radius: 16px;
    background: var(--accent); color: white; font-family: var(--font-heading);
    font-size: 15px; font-weight: 700; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-generate:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn-generate:active { transform: scale(0.98); }

/* TOAST */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 50px);
    background: var(--accent); color: white; padding: 10px 20px; border-radius: 50px;
    font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 10px 30px var(--accent-glow); opacity: 0; transition: 0.4s; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }