:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --radius: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 480px;
}

.card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.result-container {
    background-color: #0f172a;
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    border: 2px solid rgba(99, 102, 241, 0.2);
    transition: border-color 0.2s ease;
}

.result-container:focus-within {
    border-color: var(--primary);
}

.password-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    word-break: break-all;
    color: var(--accent);
    margin-right: 10px;
}

#copyBtn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

#copyBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

#copyBtn:active {
    transform: scale(0.95);
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.length-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
    cursor: pointer;
}

#lengthValue {
    font-family: 'JetBrains Mono', monospace;
    min-width: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
    user-select: none;
}

.option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.option input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.option label {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
}

.primary-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.primary-btn:active {
    transform: scale(0.98);
}

@media (max-width: 400px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}