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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Evita lo scrolling orizzontale su mobile */
html,
body {
    overflow-x: hidden;
}

header {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: #ffd700;
}

.hero {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.cta-button:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.section {
    background: white;
    padding: 4rem 2rem;
    margin: 2rem auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #667eea;
}

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

.service-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.8;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-item {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.feature-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
}

.discord-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 10px;
    margin: 2rem auto;
}

.discord-section h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.discord-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.discord-button {
    display: inline-block;
    background: white;
    color: #667eea;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.discord-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-box {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
}

.stat-label {
    color: #666;
    margin-top: 0.5rem;
}

.login-section, .register-section {
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #667eea;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #5a67d8;
}

.form-container p {
    text-align: center;
    margin-top: 1rem;
}

.form-container a {
    color: #667eea;
    text-decoration: none;
}

.form-container a:hover {
    text-decoration: underline;
}

/* Account Settings Page */
.account-settings-section {
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.settings-container {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
}

.settings-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #667eea;
    font-size: 2rem;
}

.account-info {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.account-info h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.account-info p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.change-password-section {
    background: #f0f7ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.change-password-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.change-password-section .form-group {
    margin-bottom: 1.5rem;
}

.change-password-section .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
}

.change-password-section .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 1rem;
}

.change-password-section .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.change-password-section .btn {
    margin-top: 0.5rem;
}

.change-nickname-section {
    background: #f0f7ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.change-nickname-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.change-nickname-section .form-group {
    margin-bottom: 1.5rem;
}

.change-nickname-section .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
}

.change-nickname-section .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 1rem;
}

.change-nickname-section .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.change-nickname-section .btn {
    margin-top: 0.5rem;
}

.danger-zone {
    background: #fff5f5;
    border: 2px solid #fc8181;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.danger-zone h3 {
    color: #c53030;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.delete-account-section h4 {
    color: #c53030;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.warning-text {
    background: #fed7d7;
    border-left: 3px solid #fc8181;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    color: #742a2a;
    font-size: 0.9rem;
}

.btn-danger {
    width: 100%;
    padding: 0.75rem;
    background: #fc8181;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: bold;
}

.btn-danger:hover {
    background: #f56565;
}

.btn-secondary {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: #e2e8f0;
    color: #2d3748;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
}

.modal-content h3 {
    color: #c53030;
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 1rem;
    color: #2d3748;
}

.confirmation-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #fc8181;
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.confirmation-input:focus {
    outline: none;
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(252, 129, 129, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    }

    /* ===== MFA SECTION ===== */
.mfa-section {
    background: #f0f7ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.mfa-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

/* ===== STATUS BADGE ===== */
.mfa-status {
    margin-bottom: 1rem;
}

#mfaStatus {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* OFF (default) */
#mfaStatus.off {
    background: #fed7d7;
    color: #c53030;
}

/* ON */
#mfaStatus.on {
    background: #c6f6d5;
    color: #2f855a;
}

/* ===== DESCRIPTION ===== */
.mfa-description {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 1rem;
}

/* ===== SETUP AREA ===== */
.mfa-setup {
    margin-top: 1rem;
}

/* ===== QR BOX ===== */
.qr-box {
    text-align: center;
    margin-bottom: 1rem;
}

#qrContainer img {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

/* ===== CODE INPUT ===== */
.code-box {
    display: flex;
    gap: 10px;
}

.code-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    font-size: 1rem;
}

.code-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== BUTTON VARIANTS ===== */
.btn.success {
    background: #48bb78;
}

.btn.success:hover {
    background: #38a169;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .code-box {
        flex-direction: column;
    }
}