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

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

.app-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

/* Gestione pagine */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

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

.content-wrapper {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* === PAGINA LOGIN === */
.logo-container {
    margin-bottom: 40px;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.form-container {
    margin-top: 30px;
}

.input-group {
    margin-bottom: 30px;
    text-align: left;
}

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

.input-group input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

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

/* Pulsanti */
.btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.btn i {
    font-size: 20px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
    margin-top: 20px;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(108, 117, 125, 0.3);
}

/* === PAGINA REGISTRAZIONE === */
.phrase-container {
    margin-bottom: 50px;
}

.phrase-container h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
}

.phrase-display {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 15px;
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.recording-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Animazione onda sonora */
.wave-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 60px;
    margin-bottom: 20px;
}

.wave-animation.hidden {
    display: none;
}

.wave-bar {
    width: 6px;
    height: 20px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    animation: wave 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) {
    animation-delay: 0s;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

.wave-bar:nth-child(6) {
    animation-delay: 0.5s;
}

.wave-bar:nth-child(7) {
    animation-delay: 0.6s;
}

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 50px;
    }
}

/* Pulsante microfono */
.btn-mic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-mic:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-mic:active {
    transform: scale(0.95);
}

.btn-mic.recording {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 10px 50px rgba(102, 126, 234, 0.8), 0 0 0 15px rgba(102, 126, 234, 0.2);
    }
}

/* Pulsante Send */
.btn-send {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 15px 50px;
    font-size: 20px;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

.btn-send.hidden {
    display: none;
}

.recording-status {
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

.recording-status.recording {
    color: #dc3545;
    font-weight: 600;
}

/* === PAGINA RISULTATO === */
.result-container {
    padding: 40px;
}

.result-icon {
    font-size: 100px;
    margin-bottom: 30px;
}

.result-icon.success {
    color: #28a745;
    animation: successPop 0.5s ease-out;
}

.result-icon.error {
    color: #dc3545;
    animation: errorShake 0.5s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.result-message {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
}

.result-message.success {
    color: #28a745;
}

.result-message.error {
    color: #dc3545;
}

.result-details {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 600px) {
    .content-wrapper {
        padding: 30px 20px;
    }

    .logo {
        max-width: 250px;
    }

    .phrase-display {
        font-size: 22px;
        padding: 20px;
    }

    .btn-mic {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }

    .result-icon {
        font-size: 80px;
    }

    .result-message {
        font-size: 28px;
    }
}

/* Utilità */
.hidden {
    display: none !important;
}

/* Loading spinner (per future implementazioni) */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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