/* Reset e variabili CSS */
:root {
    --primary-red: #E53E3E;
    --primary-red-dark: #C53030;
    --primary-red-light: #FC8181;
    --background: #FAFAFA;
    --surface: #FFFFFF;
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(229, 62, 62, 0.2));
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--primary-red);
    letter-spacing: -0.025em;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.language-selector select:hover {
    border-color: var(--primary-red-light);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Main content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.password-card, .verification-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.password-card:hover, .verification-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.password-card h2, .verification-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.verification-card h3 {
    font-size: 1.25rem;
}

.verification-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Password display */
.password-display {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

#passwordOutput {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
    transition: var(--transition);
}

#passwordOutput:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.copy-btn {
    padding: 1rem 1.5rem;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary-red-dark);
    transform: translateY(-1px);
}

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

/* Password options */
.password-options {
    margin-bottom: 2rem;
}

.option-group {
    margin-bottom: 1.5rem;
}

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

.length-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#passwordLength {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

#passwordLength::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#passwordLength::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-red);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#lengthValue {
    font-weight: 600;
    color: var(--primary-red);
    min-width: 2rem;
    text-align: center;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--background);
}

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

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Strength meter */
.strength-meter {
    margin-bottom: 2rem;
}

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

.strength-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

.strength-fill.weak { background: #FC8181; width: 25%; }
.strength-fill.fair { background: #F6AD55; width: 50%; }
.strength-fill.good { background: #68D391; width: 75%; }
.strength-fill.strong { background: #4FD1C7; width: 100%; }

#strengthText {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Buttons */
.generate-btn, .verify-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-top: 1rem;
}

.generate-btn:hover, .verify-btn:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.generate-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Step indicators */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
    transition: var(--transition);
    background: var(--border);
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.step.active {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.step.completed {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.step-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}

/* Captcha */
.captcha-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.captcha-challenge {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-red);
    user-select: none;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#captchaInput {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

#captchaInput:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* Back button */
.back-to-verification {
    margin-top: 2rem;
    text-align: center;
}

.back-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--background);
    border-color: var(--primary-red-light);
    color: var(--primary-red);
}

/* Footer */
footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .password-display {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.password-card, .verification-card {
    animation: fadeIn 0.5s ease-out;
}

/* Success animation */
@keyframes success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.success {
    animation: success 0.3s ease-in-out;
} 