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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --strength-weak: #ef4444;
    --strength-medium: #f59e0b;
    --strength-strong: #10b981;
    --strength-very-strong: #3b82f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.password-display {
    margin-bottom: 30px;
}

.password-output {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    transition: border-color 0.3s ease;
}

.password-output:hover {
    border-color: var(--primary-color);
}

#passwordText {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    word-break: break-all;
    flex: 1;
    color: var(--text-primary);
    min-height: 1.5em;
}

.copy-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
}

.strength-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 50px;
}

.strength-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.strength-fill.weak {
    width: 25%;
    background: var(--strength-weak);
}

.strength-fill.medium {
    width: 50%;
    background: var(--strength-medium);
}

.strength-fill.strong {
    width: 75%;
    background: var(--strength-strong);
}

.strength-fill.very-strong {
    width: 100%;
    background: var(--strength-very-strong);
}

.strength-text {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-weight: 500;
}

#lengthSlider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#lengthSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

#lengthSlider::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.2);
}

#lengthSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

#lengthSlider::-moz-range-thumb:hover {
    background: var(--primary-hover);
    transform: scale(1.2);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(99, 102, 241, 0.1);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    color: var(--text-primary);
    user-select: none;
}

.generate-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

footer .brand {
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 640px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    #passwordText {
        font-size: 1rem;
    }
}
