/* Cloudpedia password reset, Vercel-like auth card (#396, mock approved in #395).
   Scoped to .cp-reset-* so login, registration and two-factor styles
   (slicing.css, login.css) are untouched. Bootstrap 4 compatible: plain
   classes over .form-control, no version-5 attribute hooks, no color-mix.
   Colours come only from --cp-* tokens (palette.css). */

/* Canvas: centres the card on the tinted page background. */
.cp-reset-wrap,
.cp-reset-wrap *,
.cp-reset-wrap *::before,
.cp-reset-wrap *::after {
    box-sizing: border-box;
}

.cp-reset-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 48px 16px;
    background: var(--cp-surface);
    color: var(--cp-gray-900);
    font: 400 14px/1.55 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Card: surface, hairline border, no shadow. Flex column so the heading
   moves above the alerts with `order` and no markup moves. */
.cp-reset-wrap .cp-reset-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--cp-auth-max);
    padding: 0 32px 28px;
    background: var(--cp-surface);
    border: 1px solid var(--cp-border-neutral);
    border-radius: 12px;
}

/* Logo row. */
.cp-reset-card > .cp-reset-logo {
    order: -3;
    display: flex;
    justify-content: center;
    padding: 32px 0 0;
}

.cp-reset-logo img {
    display: block;
    width: auto;
    height: 36px;
    max-width: 100%;
}

/* Title + description: one rhythm across the auth pages. */
/* CloudX sets `font-weight: normal!important` on every h1-h6 (cloudx.css);
   only an equal !important restores the approved 700 title weight. */
.cp-reset-card > .cp-reset-title {
    font-family: inherit;
    order: -2;
    margin: 20px 0 8px;
    font-size: 26px;
    font-weight: 700 !important; /* cloudx-override */
    line-height: 1.25;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--cp-gray-900);
}

.cp-reset-card > .cp-reset-desc {
    order: -1;
    margin: 0 0 24px;
    font-size: 14px;
    text-align: center;
    color: var(--cp-gray-600);
}

/* Alerts (includes/alert.tpl) keep their markup; restyled to the auth look. */
.cp-reset-card .alert {
    margin: 0 0 20px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.cp-reset-card .alert.alert-danger {
    border-color: var(--cp-danger);
    background: var(--cp-danger-soft-bg);
    color: var(--cp-danger);
}

.cp-reset-card .alert.alert-success {
    border-color: var(--cp-success-500);
    background: var(--cp-success-50);
    color: var(--cp-success-700);
}

.cp-reset-card .alert.alert-warning {
    border-color: var(--cp-warning-500);
    background: var(--cp-warning-500-soft);
    color: var(--cp-warning-700);
}

.cp-reset-card .alert.alert-info {
    border-color: var(--cp-border-neutral);
    background: var(--cp-surface-muted);
    color: var(--cp-gray-600);
}

.cp-reset-card .alert ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.cp-reset-card .alert small {
    font-size: 12px;
}

.cp-reset-success-text {
    margin: 0 0 20px;
    text-align: center;
    color: var(--cp-gray-600);
}

/* Form: fields stack with one rhythm. */
.cp-reset-form {
    margin: 0;
}

.cp-reset-card .cp-reset-field {
    margin: 0 0 16px;
}

.cp-reset-card .cp-reset-field > br {
    display: none;
}

.cp-reset-label {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cp-gray-900);
}

.cp-reset-card .form-control.cp-reset-input {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: var(--cp-gray-900);
    background: var(--cp-surface);
    border: 1px solid var(--cp-border-neutral);
    border-radius: 10px;
    transition: border-color .12s, box-shadow .12s;
}

.cp-reset-card .form-control.cp-reset-input::placeholder {
    color: var(--cp-gray-600);
    opacity: .6;
}

.cp-reset-card .form-control.cp-reset-input:hover {
    border-color: var(--cp-gray-600);
}

.cp-reset-card .form-control.cp-reset-input:focus {
    outline: none;
    border-color: var(--cp-primary-500);
    box-shadow: 0 0 0 3px var(--cp-primary-50);
}

.cp-reset-card .form-control.cp-reset-input.is-invalid {
    border-color: var(--cp-danger);
}

@media (max-width: 575px) {
    .cp-reset-card .form-control.cp-reset-input {
        font-size: 16px;
    }
}

/* Password strength meter: 4px track, colour bars. Bootstrap's .bg-* and
   .mb-3 utilities are !important, so the bar colours are painted as an opaque
   background-image layer over them. */
.cp-reset-card #passwordStrengthBar {
    height: 4px;
    margin: 0 0 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--cp-border-neutral);
}

.cp-reset-card #passwordStrengthBar .progress-bar {
    height: 100%;
    background-color: transparent;
    transition: width .2s;
}

.cp-reset-card #passwordStrengthBar .progress-bar.bg-danger {
    background-image: linear-gradient(var(--cp-danger), var(--cp-danger));
}

.cp-reset-card #passwordStrengthBar .progress-bar.bg-warning {
    background-image: linear-gradient(var(--cp-warning-500), var(--cp-warning-500));
}

.cp-reset-card #passwordStrengthBar .progress-bar.bg-success {
    background-image: linear-gradient(var(--cp-success-500), var(--cp-success-500));
}

.cp-reset-card #inputNewPassword2Msg .form-text {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--cp-danger);
}

/* Primary action: full width in forms and the success state. */
.cp-reset-wrap .cp-reset-card .cp-reset-submit,
.cp-reset-wrap a.cp-reset-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--cp-primary-500);
    border-radius: 10px;
    background: var(--cp-primary-500);
    color: var(--cp-surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.cp-reset-wrap .cp-reset-card .cp-reset-submit:hover,
.cp-reset-wrap a.cp-reset-submit:hover {
    background: var(--cp-primary-600);
    border-color: var(--cp-primary-600);
    color: var(--cp-surface);
    text-decoration: none;
}

.cp-reset-card .cp-reset-submit:focus-visible,
.cp-reset-wrap a.cp-reset-submit:focus-visible {
    outline: 3px solid var(--cp-primary-300);
    outline-offset: 2px;
}

.cp-reset-card .cp-reset-submit:disabled {
    cursor: not-allowed;
    opacity: .5;
}

/* Links and footer lines. */
.cp-reset-wrap a {
    color: var(--cp-primary-500);
    font-weight: 500;
    text-decoration: none;
}

.cp-reset-wrap a:hover {
    color: var(--cp-primary-600);
    text-decoration: underline;
}

.cp-reset-foot {
    margin: 20px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--cp-gray-600);
    text-align: center;
}

/* reCAPTCHA (Google iframe, 304x78): the mount is a block that spans the
   fields and the widget sits left-aligned, same gap on every reset step.
   Bootstrap .row (flex, -15px margins) and .text-center are scoped away
   from the mount; the inner widget overrides the inherited centring. */
.cp-reset-form .captcha-cloudx-theme {
    display: block;
    margin: 4px 0 24px;
    text-align: left;
}

.cp-reset-form #google-recaptcha-domainchecker {
    flex: none;
    margin: 0;
    text-align: left;
    transform-origin: top left;
}

/* Keep WHMCS-injected images (e.g. default CAPTCHA) inside the card. */
.cp-reset-card img {
    max-width: 100%;
}

/* Narrow phones: the 304px reCAPTCHA iframe is scaled to fit the card. */
@media (max-width: 374px) {
    .cp-reset-card #google-recaptcha-domainchecker {
        transform: scale(0.9);
    }
}

@media (max-width: 350px) {
    .cp-reset-card #google-recaptcha-domainchecker {
        transform: scale(0.82);
    }
}

/* Mobile: top-aligned canvas, 20px card gutter. */
@media (max-width: 575px) {
    .cp-reset-wrap {
        justify-content: flex-start;
        padding: 24px 16px;
    }

    .cp-reset-wrap .cp-reset-card {
        padding: 0 20px 28px;
    }

    .cp-reset-card > .cp-reset-logo {
        padding: 24px 20px 0;
    }
}
