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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Pagina Index - Inserimento Codice */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

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

.header h1 {
    font-size: 3.5rem;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.5rem;
    color: #666;
}

/* Form */
.form {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.form-group input {
    width: 100%;
    padding: 20px;
    font-size: 2rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    border: 3px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    background: #667eea;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Messages */
.error-message {
    margin-top: 20px;
    padding: 15px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 8px;
    color: #c33;
    text-align: center;
    font-weight: 600;
}

.loading-message {
    margin-top: 20px;
    padding: 15px;
    background: #e3f2fd;
    border: 2px solid #90caf9;
    border-radius: 8px;
    color: #1976d2;
    text-align: center;
    font-weight: 600;
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: #999;
    font-size: 1.1rem;
}

/* Pagina View - Loading Screen */
.loading-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 8px solid #f3f3f3;
    border-top: 8px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    font-size: 1.5rem;
    color: #666;
    font-weight: 600;
}

/* Error Screen */
.error-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff5f5;
    padding: 20px;
}

.error-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 60px 40px;
    max-width: 600px;
    text-align: center;
}

.error-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.error-card h1 {
    font-size: 2.5rem;
    color: #d32f2f;
    margin-bottom: 20px;
}

.error-card p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 30px;
}

/* Content Screen */
.content-screen {
    min-height: 100vh;
    background: white;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.content-header h2 {
    font-size: 1.5rem;
    color: #333;
    flex: 1;
    text-align: center;
}

.btn-back,
.btn-fullscreen {
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover,
.btn-fullscreen:hover {
    color: white;
    background: #667eea;
}

#contentContainer {
    width: 100%;
    min-height: calc(100vh - 80px);
    overflow: auto;
}

/* Fullscreen mode */
.fullscreen #contentContainer {
    min-height: 100vh;
}

.fullscreen .content-header {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 40px 20px;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .form-group input {
        font-size: 1.5rem;
        padding: 15px;
    }

    .btn-primary {
        font-size: 1.2rem;
        padding: 15px;
    }

    .content-header {
        flex-direction: column;
        gap: 10px;
    }

    .content-header h2 {
        font-size: 1.2rem;
    }

    .btn-back,
    .btn-fullscreen {
        width: 100%;
    }
}
