/*
 * Password Recovery and Reset Password (page-templates/password_recovery.php: the pages password-recovery and
 * reset-password, the second opened from the e-mail with ?token=) restyled after the new home page (MILESTONES #35).
 * The title band, counter, colleges, registration and headquarters come from site-components.css. This sheet turns the
 * forms of amerlink-core's [shortcode_show_pass_recovery_form] (template-parts/pass_recovery_tpl.php) and
 * [shortcode_show_reset_pass_form] (reset_pass_tpl.php) into a card, with their states after posting to the same page:
 * the status line (.recovery-status-container .status, .error), the field errors of the new password (.label-validate)
 * and the form greyed out after the change (.disabled). style_tymek.css sets the section and the fields with !important
 * below 500px, hence the !important there.
 */

body.amg-skin #page-container .password-recovery-container {
    margin: 0 !important;
    padding: clamp(48px, 5vw, 80px) 16px;
    background: linear-gradient(180deg, var(--amg-soft-blue) 0%, var(--amg-soft) 55%, #fff 100%);
}

body.amg-skin #page-container .password-recovery-container .wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(100%, 560px);
    max-width: none;
    height: auto;
    margin: 0 auto;
}

body.amg-skin #page-container .password-recovery-container-inner {
    padding: clamp(26px, 4vw, 44px);
    border: 1px solid var(--amg-line);
    border-radius: var(--amg-radius-lg);
    background: #fff;
    box-shadow: var(--amg-shadow);
}

/* A key above the instruction (a lock on the new password form), drawn like the icons of the home hero cards. */
body.amg-skin #page-container .password-recovery-container-inner::before {
    display: block;
    width: 56px;
    height: 56px;
    margin-bottom: 22px;
    border-radius: 14px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='4.5'/%3E%3Cpath d='m10.7 12.3 9.3-9.3m-3 3 3 3m-6 0 2 2'/%3E%3C/svg%3E") center / 28px no-repeat,
        linear-gradient(140deg, #088be0, #0751a1);
    content: '';
}

body.amg-skin #page-container .password-recovery-container-inner:has(.resetpassform)::before {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10.5' width='16' height='10.5' rx='2'/%3E%3Cpath d='M8 10.5V7a4 4 0 0 1 8 0v3.5M12 14.5v2.5'/%3E%3C/svg%3E") center / 28px no-repeat,
        linear-gradient(140deg, #088be0, #0751a1);
}

body.amg-skin #page-container .password-recovery-container-inner .title {
    margin: 0 0 24px;
    padding: 0;
    color: var(--amg-navy);
    font: 800 clamp(20px, 1.6vw, 24px)/1.3 var(--amg-font);
    letter-spacing: -.01em;
}

/* The form: one column of full width fields; the submit button in the pink of the site's main actions
   (.my-button-2 takes its colours from these variables with !important). */
body.amg-skin #page-container .passrecoveryform {
    --color-button2: var(--amg-pink);
    --color-button2-hover: var(--amg-pink-dark);
    --color-button2-border: var(--amg-pink);
    --color-button2-border-hover: var(--amg-pink-dark);
    --color-button2-text: #fff;
    --color-button2-text-hover: #fff;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

body.amg-skin #page-container .passrecoveryform .input-item-container {
    position: relative;
    display: block;
    width: 100%;
    max-width: none !important;
    margin: 0;
}

body.amg-skin #page-container .passrecoveryform .input {
    width: 100%;
    max-width: none !important;
    height: 54px;
    padding: 0 18px;
    border: 1px solid var(--amg-field);
    border-radius: var(--amg-radius-sm);
    background: #fff;
    color: var(--amg-navy);
    font: 500 15px/1.4 var(--amg-font);
    letter-spacing: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}

body.amg-skin #page-container .passrecoveryform .input::placeholder {
    color: var(--amg-muted);
    opacity: 1;
}

body.amg-skin #page-container .passrecoveryform .input:focus {
    border-color: var(--amg-blue);
    outline: 0;
    box-shadow: var(--amg-focus);
}

/* New password fields: room for the show/hide button inside the field. */
body.amg-skin #page-container .passrecoveryform input[type='password'].input,
body.amg-skin #page-container .passrecoveryform .user-pass-item,
body.amg-skin #page-container .passrecoveryform .password-repeat-item {
    padding-right: 56px;
}

body.amg-skin #page-container .passrecoveryform .show-password-bt {
    top: auto;
    right: 1px;
    bottom: 1px;
    width: 52px;
    height: 52px;
    border-radius: 0 var(--amg-radius-sm) var(--amg-radius-sm) 0;
    color: var(--amg-muted);
    cursor: pointer;
}

body.amg-skin #page-container .passrecoveryform .show-password-bt:hover,
body.amg-skin #page-container .passrecoveryform .show-password-bt:focus-visible {
    color: var(--amg-blue);
}

/* The field error of the new password, above the field (the old form put it on the field's top border, where the
   longer messages wrapped over the typed text on phones); empty = no error. */
body.amg-skin #page-container .passrecoveryform .label-validate {
    position: static;
    display: block;
    margin: 0 0 6px;
    padding: 0;
    background: none;
    color: var(--amg-pink-dark);
    font: 600 13px/1.4 var(--amg-font);
    letter-spacing: 0;
}

body.amg-skin #page-container .passrecoveryform .label-validate:empty {
    display: none;
}

body.amg-skin #page-container .passrecoveryform .input-item-container:has(.label-validate:not(:empty)) .input {
    border-color: var(--amg-pink);
}

body.amg-skin #page-container .passrecoveryform .submit-item-container {
    margin-top: 4px;
}

body.amg-skin #page-container .passrecoveryform .pass-recover-bt {
    width: 100%;
    max-width: none !important;
    height: 54px;
    min-height: 54px;
    padding: 0 24px;
    font-size: 16px;
    letter-spacing: 0;
    box-shadow: 0 10px 22px rgba(245, 0, 114, .18);
}

body.amg-skin #page-container .passrecoveryform .pass-recover-bt:focus-visible {
    outline: 3px solid var(--amg-blue-light);
    outline-offset: 2px;
}

/* After the password has been changed the card, the form, its fields and its button all get .disabled, and
   style-divi-child.css fades each of them (.disabled .3, .passrecoveryform .disabled .7) — the fields came out almost
   invisible. One fade for the form; the card, its icon and its text stay as they are. */
body.amg-skin #page-container .password-recovery-container-inner.disabled {
    opacity: 1;
}

body.amg-skin #page-container .passrecoveryform.disabled {
    opacity: .5;
}

body.amg-skin #page-container .passrecoveryform.disabled .disabled {
    box-shadow: none;
    opacity: 1;
}

/* Status line after posting: an empty section without one. Blue = done (e-mail sent, password changed), pink = error:
   .error in the recovery form; in the new password form any status while the form is still active (errors, failure). */
body.amg-skin #page-container .recovery-status-container {
    margin: 0 !important;
    padding: 0;
}

body.amg-skin #page-container .recovery-status-container:empty {
    display: none;
}

body.amg-skin #page-container .recovery-status-container .status {
    position: relative;
    margin: 0;
    padding: 16px 18px 16px 54px;
    border: 1px solid #c4def8;
    border-left: 4px solid var(--amg-blue);
    border-radius: var(--amg-radius);
    background: var(--amg-soft-blue);
    color: var(--amg-navy);
    font: 600 15px/1.55 var(--amg-font);
    letter-spacing: 0;
}

body.amg-skin #page-container .recovery-status-container .status::before {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat var(--amg-blue);
    content: '';
}

body.amg-skin #page-container .recovery-status-container .status.error,
body.amg-skin #page-container .wrapper:has(.resetpassform:not(.disabled)) .recovery-status-container .status {
    border-color: #f7c2da;
    border-left-color: var(--amg-pink);
    background: #fff3f8;
}

body.amg-skin #page-container .recovery-status-container .status.error::before,
body.amg-skin #page-container .wrapper:has(.resetpassform:not(.disabled)) .recovery-status-container .status::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6.5v7M12 17.5v.01'/%3E%3C/svg%3E") center / 14px no-repeat var(--amg-pink);
}
