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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    padding: 40px 30px;
}

.input-section {
    margin-bottom: 30px;
}

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

textarea {
    width: 100%;
    padding: 20px;
    font-size: 1.3rem;
    border: 3px solid #e0e0e0;
    border-radius: 16px;
    resize: vertical;
    font-family: inherit;
    transition: all 0.3s ease;
    line-height: 1.6;
}

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

.char-counter {
    text-align: right;
    margin-top: 10px;
    font-size: 1rem;
    color: #666;
}

.button-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    font-size: 1.4rem;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

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

.btn-icon {
    font-size: 1.8rem;
}

.status {
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    font-size: 1.2rem;
    text-align: center;
    font-weight: 600;
    display: none;
}

.status.show {
    display: block;
}

.status.loading {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
}

.status.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

.quick-messages {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 3px solid #f0f0f0;
}

.quick-messages h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.quick-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.quick-btn {
    padding: 20px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
}

.quick-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

/* Animazioni */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.btn-primary.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive per tablet piccoli */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .button-section {
        grid-template-columns: 1fr;
    }
    
    .quick-btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Miglioramenti touch */
@media (hover: none) and (pointer: coarse) {
    .btn, .quick-btn {
        -webkit-tap-highlight-color: transparent;
    }
}
