/* ================================================================
   AutoRent — Password Reset Page Styles
   Used by: com_users/reset/default.php
   Matches: profile-edit.css design system
   ================================================================ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.reset-page {
    padding: 40px 20px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    min-height: 60vh;
}

.reset-container {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

/* ── Page heading ─────────────────────────────────────────────── */
.reset-container .page-header {
    border: 0;
    padding: 0;
    margin: 0 0 24px;
}

.reset-container .page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0a0a0a;
    margin: 0;
}

/* ── Form scope ───────────────────────────────────────────────── */
#user-reset-form,
#user-reset-confirm-form,
#user-reset-complete-form {

    /* Row: label + input */
    .form-group {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 14px;
    }

    fieldset {
        border: none;
        padding: 0;
        margin: 0 0 8px 0;
    }
    fieldset legend {
        font-size: 13px;
        font-weight: 700;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: .05em;
        margin-bottom: 12px;
        padding: 0;
    }
    fieldset > p {
        font-size: 14px;
        color: #6b7280;
        margin-bottom: 16px;
        line-height: 1.5;
    }

    .form-group .control-label {
        flex: 0 0 140px;
        font-size: 13px;
        font-weight: 600;
        color: #374151;
        margin: 0;
        padding: 0;
        line-height: 1.4;
        text-align: right;
    }
    .form-group .control-label label {
        margin: 0;
        font-weight: 600;
        color: #374151;
    }

    .form-group .controls {
        flex: 1;
        min-width: 0;
        padding: 0;
    }

    /* Hide required stars */
    .star {
        display: none !important;
    }

    /* Inputs */
    .form-control,
    .controls input[type="text"],
    .controls input[type="email"],
    .controls input[type="password"] {
        width: 100%;
        padding: 9px 14px;
        border: 2px solid #e5e7eb;
        border-radius: 10px;
        font-size: 14px;
        color: #0a0a0a;
        background: #fff;
        box-sizing: border-box;
        transition: border-color .2s, box-shadow .2s;
    }
    .form-control:focus,
    .controls input[type="text"]:focus,
    .controls input[type="email"]:focus,
    .controls input[type="password"]:focus {
        outline: none;
        border-color: #FE5001;
        box-shadow: 0 0 0 3px rgba(254,80,1,.12);
    }

    /* Form actions row */
    .form-actions,
    .control-group {
        display: flex;
        gap: 10px;
        margin-top: 24px;
        padding-top: 16px;
        border-top: 1px solid #f3f4f6;
    }

    .control-group .controls {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    /* Buttons */
    .btn-primary {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        transition: background .2s, box-shadow .2s;
        line-height: 1;
        text-decoration: none;
        background: #FE5001;
        color: #fff;
        text-transform: uppercase;
        letter-spacing: .05em;
    }
    .btn-primary svg {
        flex-shrink: 0;
        display: block;
        margin: 0 !important;
    }
    .btn-primary:hover {
        background: #E54801;
        box-shadow: 0 4px 12px rgba(254,80,1,.28);
        color: #fff;
    }
    .btn-primary:focus {
        outline: 3px solid #FE5001;
        outline-offset: 2px;
    }

    /* Cancel / back link */
    .btn-danger,
    a.btn-danger {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 20px;
        font-size: 14px;
        font-weight: 600;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        transition: background .2s, box-shadow .2s;
        line-height: 1;
        text-decoration: none;
        background: #f3f4f6;
        color: #374151;
        border: 1.5px solid #e5e7eb !important;
    }
    .btn-danger:hover,
    a.btn-danger:hover {
        background: #fee2e2;
        color: #ef4444;
        border-color: #fca5a5 !important;
    }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 540px) {
    .reset-page {
        padding: 20px 16px;
    }
    .reset-container {
        padding: 24px 20px;
    }

    #user-reset-form .form-group,
    #user-reset-confirm-form .form-group,
    #user-reset-complete-form .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    #user-reset-form .form-group .control-label,
    #user-reset-confirm-form .form-group .control-label,
    #user-reset-complete-form .form-group .control-label {
        flex: none;
        text-align: left;
    }
    #user-reset-form .form-group .controls,
    #user-reset-confirm-form .form-group .controls,
    #user-reset-complete-form .form-group .controls {
        width: 100%;
    }
}

/* ── Accessibility ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #user-reset-form .form-control,
    #user-reset-form .btn-primary,
    #user-reset-form .btn-danger,
    #user-reset-confirm-form .form-control,
    #user-reset-confirm-form .btn-primary,
    #user-reset-confirm-form .btn-danger,
    #user-reset-complete-form .form-control,
    #user-reset-complete-form .btn-primary,
    #user-reset-complete-form .input-password-toggle,
    #user-reset-complete-form meter,
    #user-reset-complete-form .password-strength-text {
        transition: none;
    }
}

/* ── High contrast ────────────────────────────────────────────── */
@media (prefers-contrast: high) {
    .reset-container {
        border: 2px solid #000;
    }
    #user-reset-form .btn-primary,
    #user-reset-form .btn-danger,
    #user-reset-confirm-form .btn-primary,
    #user-reset-confirm-form .btn-danger,
    #user-reset-complete-form .btn-primary {
        border: 2px solid #fff;
    }
}


    .container {
        max-width: 100% !important;
    }
/* ── Confirm step: inline error ───────────────────────────────── */
#reset-confirm-error {
    margin-top: 10px;
}

/* ── Fix: btn icon lost after JS text replacement ─────────────── */
#reset-confirm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Fix: form-actions buttons don't clip on narrow screens ────── */
.form-actions {
    flex-wrap: wrap;
    align-items: center;
}

/* ── Fix: input box-sizing missing from fieldset scope ──────────── */
fieldset .form-control {
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════
   CONFIRM — auto-submit loading state
══════════════════════════════════════════════════════════ */
.reset-autosubmit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 52px 20px;
    gap: 14px;
    text-align: center;
}

.reset-autosubmit p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.reset-autosubmit-email {
    font-weight: 600;
    color: #374151 !important;
    font-size: 13px !important;
}

.reset-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #e5e7eb;
    border-top-color: #FE5001;
    border-radius: 50%;
    animation: reset-spin 0.75s linear infinite;
    flex-shrink: 0;
}

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

@media (prefers-reduced-motion: reduce) {
    .reset-spinner { animation: none; border-top-color: #FE5001; }
}

/* ══════════════════════════════════════════════════════════
   CONFIRM — token expired / error state
══════════════════════════════════════════════════════════ */
.reset-token-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 44px 20px;
    gap: 10px;
}

.reset-token-error-icon {
    color: #ef4444;
    margin-bottom: 4px;
}

.reset-token-error h2 {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.reset-token-error p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 12px;
    max-width: 34ch;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   CONFIRM — email sent confirmation (state 1, no token)
══════════════════════════════════════════════════════════ */
.reset-email-sent {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 44px 20px;
    gap: 12px;
}

.reset-email-sent-icon {
    color: #FE5001;
    margin-bottom: 4px;
}

.reset-email-sent h2 {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.reset-email-sent p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px;
    max-width: 36ch;
    line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════
   COMPLETE — set new password form
══════════════════════════════════════════════════════════ */

/* Password group container */
#user-reset-complete-form .password-group {
    width: 100%;
}

/* Input group with toggle button */
#user-reset-complete-form .input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
}

#user-reset-complete-form .input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

#user-reset-complete-form .input-group .form-control:focus {
    border-right: 2px solid #FE5001;
    z-index: 1;
}

/* Password toggle button */
#user-reset-complete-form .input-password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    padding: 0;
    flex-shrink: 0;
}

#user-reset-complete-form .input-password-toggle:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

#user-reset-complete-form .input-password-toggle:focus {
    outline: none;
    border-color: #FE5001;
    box-shadow: 0 0 0 3px rgba(254, 80, 1, 0.12);
}

#user-reset-complete-form .input-password-toggle .icon-eye {
    color: #6b7280;
    flex-shrink: 0;
}

#user-reset-complete-form .input-password-toggle:hover .icon-eye {
    color: #374151;
}

/* Password requirements text */
#user-reset-complete-form .small.text-muted {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
    line-height: 1.4;
}

/* Password strength meter */
#user-reset-complete-form meter {
    width: 100%;
    height: 6px;
    margin-top: 8px;
    border-radius: 3px;
    background: #e5e7eb;
    border: none;
    appearance: none;
    -webkit-appearance: none;
}

#user-reset-complete-form meter::-webkit-meter-bar {
    background: #e5e7eb;
    border-radius: 3px;
    border: none;
}

#user-reset-complete-form meter::-webkit-meter-optimum-value {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

#user-reset-complete-form meter::-webkit-meter-suboptimum-value {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 100%);
    border-radius: 3px;
}

#user-reset-complete-form meter::-webkit-meter-even-less-good-value {
    background: #ef4444;
    border-radius: 3px;
}

#user-reset-complete-form meter::-moz-meter-bar {
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    border-radius: 3px;
}

/* Password strength text */
#user-reset-complete-form .password-strength-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    min-height: 18px;
    transition: color 0.2s;
}

#user-reset-complete-form .password-strength-text.strength-weak {
    color: #ef4444;
}

#user-reset-complete-form .password-strength-text.strength-medium {
    color: #f59e0b;
}

#user-reset-complete-form .password-strength-text.strength-strong {
    color: #22c55e;
}

/* Responsive adjustments for complete form */
@media (max-width: 540px) {
    #user-reset-complete-form .input-group {
        flex-wrap: nowrap;
    }
    
    #user-reset-complete-form .input-password-toggle {
        width: 44px;
    }
}

/* ══════════════════════════════════════════════════════════
   COMPLETE STEP — append to reset-styles.css
   Password rules checklist, strength bar, match hint,
   and top slide-in notification.
══════════════════════════════════════════════════════════ */

/* ── Top notification ─────────────────────────────────────────────────── */
.rc-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 20px;
}

.rc-notification[hidden] {
    display: none;
}

/* Error state */
.rc-notification--error {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #b91c1c;
}

/* Success state (autologin in progress) */
.rc-notification--success {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    color: #166534;
}

/* Slide-in animation — applied dynamically by JS */
.rc-notification--animate {
    animation: rcSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rcSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.rc-notification-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
    color: inherit;
}

.rc-notification-close:hover {
    opacity: 1;
}

/* ── Strength bar (div-based — reliable in all browsers) ─────────────── */
.rc-meter-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.rc-strength-bar {
    flex: 1;
    height: 5px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.rc-strength-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0;
}

.rc-strength-label {
    font-size: 11px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
    transition: color 0.3s ease;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── Rules checklist ─────────────────────────────────────────────────── */
.password-rules {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.password-rules li {
    position: relative;
    font-size: 12px;
    line-height: 1.6;
    padding: 1px 0 1px 20px;
    color: #9ca3af;
    transition: color 0.15s;
}

.password-rules li::before {
    position: absolute;
    left: 0;
    font-size: 13px;
    line-height: 1.4;
    content: '○';
}

.rule-pass          { color: #16a34a !important; }
.rule-pass::before  { content: '✓' !important; }
.rule-fail          { color: #dc2626 !important; }
.rule-fail::before  { content: '✗' !important; }
.rule-neutral       { color: #9ca3af; }

/* ── Match hint below confirm field ──────────────────────────────────── */
.rc-match-hint {
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
    line-height: 1.4;
    transition: color 0.15s;
}

.rc-match-hint--ok    { color: #16a34a; }
.rc-match-hint--error { color: #dc2626; }

/* ── Submit button ───────────────────────────────────────────────────── */
#reset-complete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    justify-content: center;
}

#reset-complete-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .rc-notification--animate { animation: none; }
    .rc-strength-fill         { transition: none; }
    .rc-strength-label        { transition: none; }
    .password-rules li        { transition: none; }
    .rc-match-hint            { transition: none; }
}