/* Page d'authentification et Profil */

.hidden {
    display: none;
}

/* Profil Styles */
.profile-header {
    padding: var(--padding-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-email {
    color: var(--neutral-gray-500);
}

/* --- Page profil Easy Horse --- */
.profile-header-main h1 {
    font-size: 1.8rem;
    color: var(--color-text-dark);
    margin-bottom: 5px;
}

.profile-logout-block {
    margin-top: auto;
    padding-top: 1rem;
    margin-bottom: 0;
}

.profile-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--neutral-gray-400);
    color: var(--neutral-gray-600);
    padding: var(--padding-sm) var(--padding-sm);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.profile-logout-btn:hover {
    background: var(--neutral-gray-100);
    color: var(--neutral-gray-600);
    border-color: var(--neutral-gray-500);
}

.profile-block {
    padding: var(--padding-sm) var(--padding-lg);
    margin-bottom: 24px;
}

.profile-block-title {
    font-size: 1.25rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-block-title i {
    opacity: 0.9;
}

.profile-pension-content,
.profile-credits-content {
    margin-top: 0.5rem;
}

.profile-pension-content p {
    margin-bottom: 1rem;
    color: var(--neutral-gray-700);
}

.profile-pension-deadline,
.profile-pension-auto {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.profile-pension-next-month,
.profile-pension-paid-until {
    margin-bottom: 0.75rem;
}

.profile-pension-auto-status {
    margin-top: -0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.profile-pension-auto-status--success {
    color: #2d6a2d;
}

.profile-pension-auto-status--error {
    color: #b42318;
    font-weight: 600;
}

.profile-pension-auto-label {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.profile-pension-pay-btn--disabled,
.profile-pension-pay-btn--disabled:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.15);
}

.profile-pension-up-to-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0.65rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d6a2d;
}

.profile-pension-up-to-date .icon {
    width: 1.1rem;
    height: 1.1rem;
    color: #2d6a2d;
}

.profile-pension-label {
    display: inline-block;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--color-text-dark);
}

.profile-pension-month-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.profile-pension-select {
    width: fit-content;
    flex: 0 0 auto;
    border: 1px solid var(--neutral-gray-300);
    border-radius: var(--border-radius);
    background: var(--bg-white);
    padding: 0.55rem 2rem 0.55rem 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 6.5L1 2.5h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    cursor: pointer;
    appearance: none;
    margin-bottom: 0;
}

.profile-pension-switch-btn {
    margin-top: 0.65rem;
    text-align: center;
}

.profile-pension-switch-text-btn {
    border: 0;
    background: transparent;
    padding: 0;
    width: fit-content;
    font: inherit;
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    display: block;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.profile-pension-switch-text-btn:hover {
    color: var(--primary-color-dark, var(--primary-color));
}

.profile-pension-switch-text-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-pension-deadline i,
.profile-pension-auto i {
    color: var(--primary-color);
}

.profile-credits-summary {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--primary-color);
}

.profile-credits-summary strong {
    font-weight: 600;
}

.profile-credits-breakdown {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}


.profile-credits-category {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    padding: var(--padding-sm) var(--padding-sm);
    border: 1px solid var(--neutral-gray-200);
}

.profile-credits-category-title {
    color: var(--color-text-dark);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--neutral-gray-200);
}

.profile-credits-rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-credits-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.profile-credits-label {
    color: var(--neutral-gray-700);
    font-size: 0.9rem;
}

.profile-credits-value {
    font-weight: 600;
    color: var(--color-text-dark);
    font-variant-numeric: tabular-nums;
    min-width: 1.5em;
    text-align: right;
}

.profile-error,
.profile-loading {
    color: var(--neutral-gray-700);
    margin: 0;
}

.profile-credits-action {
    margin-top: 1.25rem;
}

/* --- Drawer Mon Espace --- */
.profile-drawer-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 2050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.profile-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.profile-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: #fcfcfb;
    box-shadow: var(--shadow-drawer);
    z-index: 2100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
}

.profile-drawer-overlay.is-open .profile-drawer-panel {
    transform: translateX(0);
}

.profile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem var(--padding-sm);
    flex-shrink: 0;
}

.profile-drawer-close {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-gray-700);
    transition: background 0.2s, color 0.2s;
}

.profile-drawer-close:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.profile-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem var(--padding-sm) var(--padding-sm);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fcfcfb;
}

.profile-drawer-body .profile-header {
    padding: var(--padding-sm);
    margin-bottom: 20px;
}

.profile-drawer-body .profile-block {
    padding: var(--padding-sm) var(--padding-sm);
    margin-bottom: 16px;
}

.profile-drawer-body .profile-block-title {
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
}

.profile-drawer-body .profile-logout-block {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Formulaire connexion / inscription dans le drawer */
.profile-drawer-body .drawer-auth-form {
    padding: 0.25rem 0;
}

.profile-drawer-body .drawer-auth-title {
    font-family: 'Lato', sans-serif;
    margin-bottom: 1.25rem;
    font-size: 1.35rem;
    color: var(--primary-color, #2d5a27);
}

.profile-drawer-body .drawer-forgot-row {
    margin-bottom: 0.5rem;
}

.profile-drawer-body .drawer-forgot-link {
    font-size: 0.9rem;
    color: var(--primary-color, #2d5a27);
    text-decoration: none;
}

.profile-drawer-body .drawer-forgot-link:hover {
    text-decoration: underline;
}

.profile-drawer-body .drawer-auth-btn,
.profile-drawer-body .drawer-secondary-btn {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0;
    border-radius: 9999px;
    padding: var(--padding-sm) var(--padding-sm);
}

.profile-drawer-body .drawer-secondary-btn {
    margin-top: 0.75rem;
    display: block;
    text-align: center;
}

.profile-drawer-body .drawer-forgot-back {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--primary-color, #2d5a27);
    text-decoration: none;
}

.profile-drawer-body .drawer-forgot-back:hover {
    text-decoration: underline;
}
