/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container principal */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-white);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo i {
    font-size: 3rem;
    color: var(--secondary-color);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.description {
    font-size: 1rem;
    opacity: 0.8;
}

/* Contenu principal */
.main-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Section mot de passe */
.password-section,
.controls-section {
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.controls-section {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #f0f4f8 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.controls-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.controls-section .section-title {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.controls-section .section-subtitle {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.password-display {
    position: relative;
    margin-bottom: 1rem;
}

.password-input {
    width: 100%;
    padding: 1.25rem 5rem 1.25rem 1.25rem;
    font-size: 1.125rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-align: center;
    transition: var(--transition);
    letter-spacing: 0.05em;
}

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

.password-input:not(:placeholder-shown) {
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f8fafc 100%);
    border-color: var(--secondary-color);
}

.password-actions {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.copy-btn {
    background: var(--secondary-color);
    color: var(--text-white);
}

.copy-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.refresh-btn {
    background: var(--primary-color);
    color: var(--text-white);
}

.refresh-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.refresh-btn:active {
    transform: rotate(180deg);
}

/* Indicateur de force */
.strength-indicator {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.strength-fill {
    height: 100%;
    transition: var(--transition-slow);
    border-radius: 4px;
}

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

.strength-fill.medium {
    width: 60%;
    background: var(--warning-color);
}

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

.strength-text {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.strength-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.strength-percentage {
    font-size: 1rem;
    font-weight: 600;
}

.strength-text.weak {
    color: var(--danger-color);
}

.strength-text.medium {
    color: var(--warning-color);
}

.strength-text.strong {
    color: var(--secondary-color);
}

/* Section contrôles */
.controls-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    text-align: center;
}

.control-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.control-label span {
    font-size: 1.125rem;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
    margin-top: 1rem;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
}

/* Grille d'options */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.option-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.option-item:active {
    transform: translateY(0);
}

.option-item input:checked + .checkmark + .option-text {
    color: var(--primary-color);
    font-weight: 600;
}

.option-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.option-item input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-item input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-white);
    font-weight: bold;
    font-size: 12px;
}

.option-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.option-text small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
}

.option-text i {
    color: var(--text-secondary);
    width: 16px;
    margin-right: 0.5rem;
}

/* Bouton générer */
.generate-btn {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.generate-btn:hover i {
    animation: sparkle 0.6s ease-in-out;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

/* Section informations */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.security-tips,
.features {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.security-tips h3,
.features h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.security-tips h3 i {
    color: var(--warning-color);
}

.features h3 i {
    color: var(--secondary-color);
}

.security-tips ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.security-tips li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.security-tips li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.feature-item {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-item span {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.feature-item small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-white);
    opacity: 0.8;
}

.footer p {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem !important;
}

.privacy-note i {
    color: var(--secondary-color);
}

.footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer a:hover {
    color: #059669;
    text-decoration: underline;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--secondary-color);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    transition: var(--transition);
}

.toast.show {
    transform: translateX(0);
}

.toast.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        max-width: 100%;
    }
    
    .main-content {
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .controls-section {
        padding: 1.5rem;
    }
    
    .controls-section .section-title {
        font-size: 1.25rem;
    }
    
    .controls-section .section-subtitle {
        font-size: 0.9rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2.5rem;
    }
    
    .password-input {
        padding: 1rem 4rem 1rem 1rem;
        font-size: 1rem;
    }
    
    .password-actions {
        right: 0.5rem;
    }
    
    .action-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .info-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        transform: translateY(-100%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .strength-indicator {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .strength-text {
        align-items: center;
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
        max-width: 100%;
    }
    
    .main-content {
        padding: 1rem;
        border-radius: var(--radius-lg);
    }
    
    .logo h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1.125rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .strength-percentage {
        font-size: 0.9rem;
    }
    
    .strength-label {
        font-size: 0.7rem;
    }
}