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

html {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    min-height: 100dvh; /* Safari iOS support */
    height: 100%;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* États d'authentification */
.auth-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 24px;
}

.auth-loading p {
    margin-top: 16px;
    color: #6b7280;
    font-size: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #b8a990;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Page de connexion */
.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.login-container h2 {
    color: #b8a990;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.login-description {
    color: #6b7280;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
    text-align: left;
}

.login-form {
    text-align: left;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    color: #374151;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #b8a990;
    box-shadow: 0 0 0 3px rgba(184, 169, 144, 0.1);
}


.btn-primary {
    background: linear-gradient(135deg, #b8a990 0%, #a69984 100%);
    color: white;
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(184, 169, 144, 0.3);
}


.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.login-error p {
    color: #dc2626;
    margin: 0;
    font-size: 14px;
}

/* Container principal */
.container {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    min-height: 100dvh; /* Safari iOS support */
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Interface principale */
#mainInterface {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

/* Texte d'instruction */
.instruction-text {
    text-align: center;
    padding: 60px 30px 40px 30px;
    max-width: 500px;
    margin: 0 auto;
}

.instruction-text p {
    font-size: 18px;
    line-height: 1.5;
    color: #2c3e50;
    margin: 0;
    font-weight: 400;
}

/* Contenu principal */
.content {
    padding: 32px 24px;
    background: white;
}

.content p {
    color: #4a5568;
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.7;
}

/* Section enregistrement */
.recording-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 40px 20px;
}

/* Bouton d'enregistrement rouge avec icônes */
.record-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 auto;
}

.record-button-red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.record-button-red:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #ff6b5a 0%, #e74c3c 100%);
}

.record-button-red:active {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.record-button.recording {
    animation: pulse 2s infinite;
}

.record-button-pause {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.3);
}

.record-button-pause:hover {
    background: linear-gradient(135deg, #ffb84d 0%, #f39c12 100%);
}

.rec-icon {
    font-size: 32px;
    font-weight: bold;
}

.record-button span {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Icône pause */
.pause-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.pause-icon::before,
.pause-icon::after {
    content: '';
    width: 6px;
    height: 20px;
    background: white;
    border-radius: 2px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Compteur de learnings */
.learning-counter {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #b8a990;
    margin: 25px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #b8a990;
}

/* Boutons génériques */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    min-width: 140px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn {
    background: linear-gradient(135deg, #b8a990 0%, #a69984 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(184, 169, 144, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-outline {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    box-shadow: none;
}

.btn-outline:hover {
    background: #e74c3c;
    color: white;
}

/* Sections actions et finale */
.action-section, .final-section {
    margin: 30px 0;
}

.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Classe utilitaire */
.hidden {
    display: none;
}

/* Signature */
.signature {
    padding: 24px 28px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.signature p {
    margin-bottom: 8px;
    color: #4a5568;
}

.signature strong {
    color: #b8a990;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        margin: 0;
        box-shadow: none;
    }
    
    .instruction-text {
        padding: 40px 20px 30px 20px;
    }
    
    .instruction-text p {
        font-size: 16px;
    }
    
    .recording-section {
        padding: 20px 15px;
    }
    
    .content {
        padding: 24px 16px;
    }
    
    .record-button {
        width: 120px;
        height: 120px;
        font-size: 16px;
    }
    
    .learning-counter {
        font-size: 20px;
        margin: 20px 0;
        padding: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
}
