/* ── Reset password page ───────────────────────────────────────── */

/* Neutralise les paddings globaux de <main> */
main:has(#content-resetpwd) {
    padding: 0;
    min-height: unset;
}

/* Desktop : pas de scroll au niveau de html/body */
@media (min-width: 901px) {
    html, body { height: 100%; overflow: hidden; }
}

#content-resetpwd {
    height: 100dvh;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: var(--img);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
#content-resetpwd::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.35) 100%);
}

/* Carte */
.resetpwd-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    background: rgba(255,255,255,.97);
    border-radius: 16px;
    padding: 2.5rem 2.8rem;
    box-shadow: 0 24px 60px rgba(0,0,0,.28), 0 4px 16px rgba(0,0,0,.14);
    backdrop-filter: blur(4px);
}

/* Logo */
.resetpwd-logo-wrap { display: flex; justify-content: center; margin-bottom: 1.6rem; }
.resetpwd-logo-wrap img {
    display: block; max-width: 340px; max-height: 136px;
    width: auto; height: auto; object-fit: contain;
}

/* Icône centrale */
.resetpwd-icon-wrap { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.resetpwd-icon-wrap .icon-circle {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(240,206,84,.15); border: 2px solid rgba(240,206,84,.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--accent-color);
}

/* Header */
.resetpwd-header { text-align: center; margin-bottom: 1.8rem; }
.resetpwd-header h1 {
    font-size: 1.45rem; font-weight: 700; margin: 0 0 .4rem;
    color: var(--text-color-dark); letter-spacing: -.3px;
}
.resetpwd-header p { font-size: .82rem; color: #7a7a8a; margin: 0; line-height: 1.55; }

/* Champ */
.resetpwd-field { margin-bottom: 1.2rem; }
.resetpwd-field label {
    display: block; font-size: .76rem; font-weight: 600;
    letter-spacing: .4px; text-transform: uppercase; color: #555; margin-bottom: .4rem;
}
.resetpwd-input-wrap { position: relative; display: flex; align-items: center; }
.resetpwd-input-wrap .field-icon {
    position: absolute; left: 1rem; color: #c0c5ce; font-size: .88rem; pointer-events: none;
}
.resetpwd-input-wrap input {
    width: 100%; padding: .76rem .9rem .76rem 2.6rem;
    border: 1.5px solid #dde0e6; border-radius: 8px; font-size: .94rem;
    font-family: var(--my-font), sans-serif; color: var(--text-color-dark); background: #f9fafb;
    transition: border-color .2s, box-shadow .2s, background .2s;
    box-sizing: border-box; min-width: unset; margin: 0;
}
.resetpwd-input-wrap input:focus {
    outline: none; border-color: var(--accent-color); background: #fff;
    box-shadow: 0 0 0 3px rgba(240,206,84,.25);
}
.resetpwd-field.field-error .resetpwd-input-wrap input {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important;
    animation: shake .35s ease;
}

@keyframes shake {
    0%,100%{ transform:translateX(0); }
    20%{ transform:translateX(-5px); }
    40%{ transform:translateX(5px); }
    60%{ transform:translateX(-3px); }
    80%{ transform:translateX(3px); }
}

/* Bouton submit */
#btn-resetpwd {
    width: 100%; padding: .82rem;
    background: var(--primary-color); color: var(--text-color-light);
    border: none; border-radius: 8px; font-size: .97rem; font-weight: 600;
    font-family: var(--my-font), sans-serif; cursor: pointer;
    transition: opacity .2s, transform .1s;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    min-width: unset; margin-bottom: 1.3rem;
}
#btn-resetpwd:hover  { opacity: .86; }
#btn-resetpwd:active { transform: scale(.98); }
#btn-resetpwd.loading { pointer-events: none; opacity: .7; }
#btn-resetpwd .spinner {
    display: none; width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: spin .6s linear infinite;
}
#btn-resetpwd.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Liens bas de carte */
.resetpwd-links { display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.resetpwd-links a {
    font-size: .81rem; color: #6b7280; text-decoration: none;
    display: inline-flex; align-items: center; gap: .35rem; transition: color .15s;
}
.resetpwd-links a:hover { color: var(--text-color-dark); }
.resetpwd-links a i { font-size: .72rem; transition: transform .2s; }
.resetpwd-links a:hover i.fa-arrow-left { transform: translateX(-3px); }

/* Message succès inline */
#resetpwd-success { display: none; text-align: center; padding: .5rem 0 .2rem; }
#resetpwd-success .success-icon { font-size: 2.6rem; color: #22c55e; margin-bottom: .7rem; }
#resetpwd-success h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; color: var(--text-color-dark); }
#resetpwd-success p  { font-size: .82rem; color: #6b7280; line-height: 1.55; margin: 0 0 1.2rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    html, body { height: auto; overflow: auto; }
    main:has(#content-resetpwd) { padding: 0; min-height: unset; }
    #content-resetpwd {
        height: auto; min-height: 100dvh; overflow: visible;
        padding: 2.5rem 1.5rem; background-attachment: scroll;
    }
    .resetpwd-card { max-height: none; max-width: 480px; padding: 2.2rem 2.4rem; }
    .resetpwd-logo-wrap img { max-width: 260px; max-height: 100px; }
}

@media (max-width: 480px) {
    #content-resetpwd { padding: 1.5rem 1rem; }
    .resetpwd-card { max-height: none; max-width: 100%; padding: 1.8rem 1.2rem; border-radius: 12px; }
    .resetpwd-logo-wrap img { max-width: 180px; max-height: 72px; }
}
