@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #f8fafc;
    --background-color: #1e293b;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-border: #d1d5db;
    --disabled-color: #94a3b8;
    --success-color: #10b981;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --box-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h1 {
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

h2 {
    color: var(--text-color);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 18px 0;
}

.password-types {
    display: flex;
    background-color: #f8fafc;
    border-radius: var(--border-radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.type-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    position: relative;
}

.type-btn.active {
    background-color: white;
    color: var(--text-color);
    box-shadow: var(--box-shadow-sm);
    font-weight: 600;
}

.type-btn:hover:not(.active) {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.6);
}

.customization {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.length-control {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.length-control label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    appearance: none;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) 50%, #e5e7eb 50%, #e5e7eb 100%);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.15s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

input[type="number"] {
    width: 48px;
    padding: 8px 4px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--input-border);
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background-color: #f9fafb;
}

input[type="number"]::-webkit-inner-spin-button {
    opacity: 1;
}

.toggle-container {
    margin-bottom: 16px;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.toggle-label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-switch {
    /* Margin handled by gap in toggle-row */
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: all 0.2s ease;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: all 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.password-output {
    margin-bottom: 24px;
}

.password-output input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    font-size: 16px;
    font-family: 'JetBrains Mono', 'Monaco', 'Courier New', monospace;
    letter-spacing: 0.5px;
    outline: none;
    background-color: #f9fafb;
    color: var(--text-color);
    font-weight: 500;
    text-align: center;
    transition: all 0.15s ease;
}

.password-output input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: white;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn.primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.secondary {
    background-color: white;
    border: 1px solid var(--input-border);
    color: var(--text-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.secondary:hover {
    background-color: #f8fafc;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn.secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (max-width: 500px) {
    .container {
        padding: 24px;
        max-width: 90vw;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .toggle-row {
        gap: 16px;
    }
    
    .slider-container {
        gap: 12px;
    }
    
    input[type="number"] {
        width: 44px;
    }
}