/* =============================================================================
   AUTH PAGES - auth.css
   Styles partagés pour les pages de connexion et d'inscription
   ============================================================================= */

/* --- Conteneur de la carte d'authentification --- */
.auth-card {
    max-width: 440px;
    margin: 30px auto 0;
    background: #ea588512;
    border: 1px solid #9f5f733b;
    border-radius: 25px;
    padding: 45px 40px;
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
}

/* Titre centré */
.auth-card h2 {
    text-align: center;
    font-size: 1.7em;
    font-weight: 700;
    margin: 0 0 8px;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--grey-17);
    font-size: 0.95em;
    margin: 0 0 30px;
}

/* --- Champs de formulaire --- */
.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100% !important;
    min-width: unset !important;
}

.auth-card .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-card label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--black);
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #9f5f733b;
    border-radius: 12px;
    background: var(--grey-1);
    color: var(--black);
    font-size: 0.95em;
    transition: border-color 200ms, box-shadow 200ms;
    box-sizing: border-box;
}

.auth-card input:focus {
    border-color: var(--purple-1);
    box-shadow: 0 0 0 3px var(--purple-o-1);
    outline: none;
}

/* Bouton submit */
.auth-card button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--purple-1);
    color: white;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 200ms;
    box-shadow: var(--purple-o-1) 0px 8px 15px;
    margin-top: 5px;
}

.auth-card button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--purple-o-1) 0px 12px 25px;
}

/* Lien vers l'autre page */
.auth-card .auth-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: var(--grey-17);
}

.auth-card .auth-link a {
    color: var(--purple-1);
    text-decoration: none;
    font-weight: 600;
}

.auth-card .auth-link a:hover {
    text-decoration: underline;
}

/* --- Messages d'erreur --- */
.auth-errors {
    background: #ff000015;
    border: 1px solid #ff000040;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 5px;
}

.auth-errors p {
    margin: 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #d32f2f;
    margin-bottom: 6px;
}

.auth-errors ul {
    margin: 0;
    padding-left: 20px;
}

.auth-errors li {
    font-size: 0.85em;
    color: #d32f2f;
    margin-bottom: 3px;
}

/* --- Upload Modal (popup de publication) --- */
.modal-overlay {
    z-index: 1001;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--grey-1);
    border: 1px solid #9f5f733b;
    border-radius: 20px;
    padding: 35px 30px;
    width: 95%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-card h3 {
    margin: 0 0 20px;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--black);
}

.modal-card input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #9f5f733b;
    border-radius: 12px;
    background: #ea588508;
    cursor: pointer;
    margin-bottom: 12px;
    color: var(--black);
    font-size: 0.9em;
    box-sizing: border-box;
}

.modal-card textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #9f5f733b;
    border-radius: 12px;
    background: var(--grey-1);
    color: var(--black);
    font-size: 0.95em;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    font-family: 'Manrope', sans-serif;
    box-sizing: border-box;
}

.modal-card textarea:focus,
.modal-card input:focus {
    border-color: var(--purple-1);
    box-shadow: 0 0 0 3px var(--purple-o-1);
    outline: none;
}

.modal-card input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #9f5f733b;
    border-radius: 12px;
    background: var(--grey-1);
    color: var(--black);
    font-size: 0.95em;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms;
}

.modal-actions .btn-submit {
    background: var(--purple-1);
    color: white;
    box-shadow: var(--purple-o-1) 0px 8px 15px;
}

.modal-actions .btn-submit:hover {
    transform: translateY(-2px);
}

.modal-actions .btn-cancel {
    background: #ea588512;
    border: 1px solid #9f5f733b;
    color: black;
}

.modal-actions .btn-cancel:hover {
    background: #ea588525;
}

/* --- Edit page : sections de revenus --- */
.edit-section {
    background: #ea588512;
    border: 1px solid #9f5f733b;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 25px;
}

.edit-section h2.title {
    margin-bottom: 20px;
}

.revenue-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.revenue-stat {
    flex: 1;
    background: var(--grey-1);
    border: 1px solid #9f5f733b;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.revenue-stat h3 {
    margin: 0 0 8px;
    font-size: 0.95em;
    color: var(--grey-17);
    font-weight: 500;
}

.revenue-stat .amount {
    font-size: 2em;
    font-weight: 800;
}

.revenue-stat .amount.green {
    color: #4CAF50;
}

.revenue-stat .amount.orange {
    color: #FF9800;
}

/* Tableau de l'historique */
.edit-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.edit-table th {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #9f5f733b;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--grey-17);
}

.edit-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #9f5f7315;
    font-size: 0.9em;
}

.edit-table tr:hover td {
    background: #ea588508;
}

/* Payout form */
.payout-box {
    background: var(--grey-1);
    border: 1px solid #4CAF5050;
    padding: 25px;
    border-radius: 15px;
}

.payout-box h3 {
    margin: 0 0 15px;
    color: #4CAF50;
    font-size: 1.05em;
}

.payout-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.payout-form input[type="email"] {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #9f5f733b;
    border-radius: 12px;
    background: var(--grey-1);
    color: var(--black);
    font-size: 0.95em;
    min-width: 200px;
}

.payout-form button {
    padding: 12px 22px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms;
}

.payout-form button:hover {
    background: #45a049;
}

.payout-note {
    font-size: 0.82em;
    color: var(--grey-17);
    margin: 12px 0 0;
}

/* Alert messages */
.alert-success {
    background: #4CAF5020;
    border: 1px solid #4CAF5050;
    color: #4CAF50;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 500;
}

.alert-error {
    background: #ff000015;
    border: 1px solid #ff000040;
    color: #d32f2f;
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-weight: 500;
}

/* --- Toggle voir/cacher le mot de passe --- */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    width: 100%;
    padding-right: 48px; /* espace pour le bouton œil */
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--grey-17, #888);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 200ms;
    width: auto;
    box-shadow: none;
    margin: 0;
}

.toggle-password:hover {
    color: var(--purple-1, #5f3ee5);
    transform: translateY(-50%);
    box-shadow: none;
}

/* Lien mot de passe oublié */
.auth-forgot {
    text-align: right;
    margin-top: -6px;
}

.auth-forgot a {
    font-size: 0.83em;
    color: var(--grey-17, #888);
    text-decoration: none;
    transition: color 200ms;
}

.auth-forgot a:hover {
    color: var(--purple-1, #5f3ee5);
    text-decoration: underline;
}

/* --- Loader pendant l'upload de fichier --- */
.upload-loader-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.upload-loader-overlay.active {
    display: flex;
}

.upload-loader-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #EA5885;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.upload-loader-text {
    color: white;
    font-size: 1.05em;
    font-weight: 600;
    text-align: center;
    padding: 0 20px;
}

.upload-loader-progress {
    width: 220px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    overflow: hidden;
}

.upload-loader-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #EA5885, #5f3ee5);
    border-radius: 4px;
    transition: width 0.3s ease;
    animation: indeterminate 1.4s ease infinite;
}

@keyframes indeterminate {
    0%   { transform: translateX(-100%); width: 60%; }
    50%  { transform: translateX(60%);  width: 60%; }
    100% { transform: translateX(200%); width: 60%; }
}

/* --- Responsive auth --- */
@media screen and (max-width: 500px) {
    .auth-card {
        margin: 20px 15px;
        padding: 30px 25px;
    }

    .revenue-stats {
        flex-direction: column;
    }

    .payout-form {
        flex-direction: column;
    }

    .payout-form input,
    .payout-form button {
        width: 100%;
    }
}