:root {
    --bg-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --input-bg: rgba(15, 23, 42, 0.5);
    --border: rgba(255, 255, 255, 0.08);
    --hr-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.2);
    --input-bg: rgba(241, 245, 249, 0.9);
    --border: rgba(15, 23, 42, 0.08);
    --hr-color: rgba(15, 23, 42, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background 0.4s ease, color 0.4s ease, border 0.4s ease;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-gradient);
    background-attachment: fixed;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    padding: 40px 20px;
}

.theme-switch {
    position: sticky;
    top: 20px;
    align-self: flex-end;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-main);
    z-index: 100;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    margin-bottom: 60px;
}

h1 {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    color: var(--accent);
}

.display-box {
    background: var(--input-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#passwordResult {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.3rem;
    word-break: break-all;
    color: var(--text-main);
}

.strength-container {
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
}

#strengthBar { height: 100%; width: 0%; transition: width 0.3s ease; }

.setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.setting label { color: var(--text-muted); }

input[type="range"] {
    width: 100%;
    margin: 10px 0 24px 0;
    cursor: pointer;
    accent-color: var(--accent);
}

.actions { display: flex; gap: 10px; }

button.main-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary { background: var(--accent); color: white; }
.btn-secondary { background: var(--input-bg); color: var(--text-main); border: 1px solid var(--border); }

footer {
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-top: auto;
}

hr {
    border: 0;
    height: 1px;
    background: var(--hr-color);
    margin-bottom: 25px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent); }

.branding { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 8px; }
.other-sites { font-size: 0.85rem; color: var(--text-muted); }
.other-sites a { color: var(--accent); text-decoration: none; font-weight: 600; }

#toast {
    position: fixed;
    bottom: 30px;
    background: #10b981;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    transform: translateY(100px);
    transition: transform 0.3s ease;
    z-index: 1000;
}


.back-home-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-home-btn:hover {
    background: rgba(0, 242, 255, 0.2);
    border-color: #00f2ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 255, 0.2);
}
