:root {
    --forgot-primary: var(--cc-brand-primary, #0054a4);
    --forgot-primary-strong: var(--cc-brand-primary-strong, #024585);
    --forgot-danger: var(--cc-danger, #e30e10);
    --forgot-text-main: var(--cc-text-main, #212529);
    --forgot-text-body: var(--cc-text-body, #4a4a4a);
    --forgot-text-muted: var(--cc-text-muted, #767676);
    --forgot-border-mid: #c8d9ec;
    --forgot-border-soft: #dbe7f5;
    --forgot-panel: #f7f9fc;
    --forgot-blue-soft: #eef4fb;
}

.forgot-shell {
    display: grid;
    width: min(920px, 96vw);
    min-height: min(84vh, 720px);
    margin: clamp(1rem, 4vh, 2.8rem) auto;
    place-items: center;
}

.forgot-card {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
    width: min(860px, 100%);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--forgot-border-soft);
    border-radius: 1.15rem;
    background: #ffffff;
    box-shadow: 0 26px 65px rgba(2, 69, 133, 0.18);
    animation: cc-card-enter 0.45s ease;
}

.forgot-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    min-height: 480px;
    padding: clamp(1.5rem, 3vw, 2.2rem);
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(145deg, var(--forgot-primary) 0%, var(--forgot-primary-strong) 100%);
}

.forgot-brand-panel::after {
    content: "";
    position: absolute;
    right: -86px;
    bottom: -96px;
    width: 270px;
    height: 270px;
    border: 34px solid rgba(255, 255, 255, 0.065);
    border-radius: 50%;
    pointer-events: none;
}

.forgot-brand-top,
.forgot-progress {
    position: relative;
    z-index: 1;
}

.forgot-brand {
    display: flex;
    align-items: center;
    margin-bottom: 1.4rem;
}

.forgot-brand__logo {
    width: min(220px, 72vw);
    max-height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.22));
}

.forgot-brand__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    margin-bottom: 0.85rem;
    padding: 0.28rem 0.58rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.forgot-brand-panel h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    line-height: 1.2;
}

.forgot-brand-panel p {
    max-width: 35ch;
    margin: 0.7rem 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9rem;
    line-height: 1.55;
}

.forgot-progress__label {
    display: block;
    margin-bottom: 0.65rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.forgot-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.forgot-step {
    position: relative;
    display: grid;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.68rem;
}

.forgot-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 29px;
    right: 5px;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.forgot-step__number {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.72);
    background: var(--forgot-primary-strong);
    font-size: 0.7rem;
    font-weight: 800;
}

.forgot-step.is-current,
.forgot-step.is-complete {
    color: #ffffff;
}

.forgot-step.is-current .forgot-step__number {
    border-color: #ffffff;
    color: var(--forgot-primary-strong);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.forgot-step.is-complete .forgot-step__number {
    border-color: rgba(255, 255, 255, 0.85);
    color: var(--forgot-primary-strong);
    background: rgba(255, 255, 255, 0.88);
}

.forgot-step.is-complete:not(:last-child)::after {
    background: rgba(255, 255, 255, 0.72);
}

.forgot-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.65rem);
    background: #ffffff;
}

.forgot-form-head {
    margin-bottom: 1rem;
}

.forgot-form-head__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 0.8rem;
    border: 1px solid var(--forgot-border-mid);
    border-radius: 0.65rem;
    color: var(--forgot-primary);
    background: var(--forgot-blue-soft);
    font-size: 1.1rem;
}

.forgot-form-head__eyebrow {
    display: block;
    margin-bottom: 0.28rem;
    color: var(--forgot-primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.forgot-form-head h1 {
    margin: 0;
    color: var(--forgot-text-main);
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.2;
}

.forgot-form-head p {
    margin: 0.4rem 0 0;
    color: var(--forgot-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.forgot-form-panel fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.forgot-form-panel .form-floating-out {
    margin: 0.9rem 0;
}

.forgot-form-panel .form-floating-out > :is(input, select) {
    min-height: 44px;
    border-color: var(--forgot-border-mid);
    color: var(--forgot-text-main);
    background: #ffffff;
    box-shadow: none;
}

.forgot-form-panel .form-floating-out > :is(input, select):focus {
    border-color: var(--forgot-primary);
    box-shadow: 0 0 0 3px rgba(0, 84, 164, 0.12);
}

.forgot-form-panel .form-floating-out:focus-within > label,
.forgot-form-panel .form-floating-out > input:not(:placeholder-shown) + label {
    color: var(--forgot-primary);
}

.forgot-form-panel .form-floating-out.has-toggle input {
    padding-right: 3.1rem;
}

.forgot-submit-button,
body .forgot-submit-button {
    width: 100%;
    min-height: 44px;
    margin-top: 0.35rem;
    border: 1px solid var(--forgot-primary) !important;
    border-radius: 0.5rem !important;
    color: #ffffff !important;
    background: var(--forgot-primary);
    box-shadow: none;
    filter: none;
    font-size: 0.85rem;
    transform: none;
}

.forgot-submit-button:hover,
.forgot-submit-button:focus,
body .forgot-submit-button:hover,
body .forgot-submit-button:focus {
    border-color: var(--forgot-primary-strong) !important;
    color: #ffffff !important;
    background: var(--forgot-primary-strong);
    box-shadow: none;
    filter: none;
    transform: none;
}

.forgot-meta {
    margin: 1.15rem 0 0;
    color: var(--forgot-text-muted);
    font-size: 0.86rem;
    text-align: center;
}

.forgot-meta a {
    margin-left: 0.2rem;
    color: var(--forgot-primary);
    font-weight: 700;
}

.forgot-meta a:hover {
    color: var(--forgot-primary-strong);
}

.otp-input {
    font-family: var(--cc-font-monospace, monospace) !important;
    font-size: 1.15rem !important;
    font-weight: 700;
    letter-spacing: 0.48rem;
    text-align: center;
}

.password-toggle {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--forgot-primary-strong);
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus,
.password-toggle:active {
    color: var(--forgot-primary);
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    transform: translateY(-50%) !important;
}

.password-toggle:focus-visible {
    outline: 2px solid rgba(0, 84, 164, 0.28);
    outline-offset: 1px;
}

.password-policy,
.password-error {
    margin: 0.28rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.password-policy {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--forgot-border-soft);
    border-radius: 0.5rem;
    color: var(--forgot-text-muted);
    background: var(--forgot-panel);
}

.password-policy i {
    flex: 0 0 auto;
    color: var(--forgot-primary);
}

.password-error {
    min-height: 1.1rem;
    color: var(--forgot-danger);
}

.btn-loading {
    position: relative;
    padding-right: 40px !important;
    opacity: 0.72;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 15px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 1;
    animation: forgot-button-spin 0.6s linear infinite;
}

body > .message.success {
    border-left-color: var(--forgot-primary);
    color: #0a3a6a;
    background: rgba(0, 84, 164, 0.1);
}

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

@media (max-width: 720px) {
    .forgot-shell {
        width: 100%;
        min-height: auto;
        margin-top: 0.6rem;
    }

    .forgot-card {
        grid-template-columns: 1fr;
        border-radius: 0.92rem;
    }

    .forgot-brand-panel {
        min-height: auto;
        gap: 1.4rem;
    }

    .forgot-brand-panel h2,
    .forgot-brand-panel p {
        display: none;
    }

    .forgot-brand {
        margin-bottom: 0.8rem;
    }

    .forgot-brand__logo {
        width: min(190px, 66vw);
    }

    .forgot-form-panel {
        padding: 1.35rem;
    }
}

@media (max-width: 420px) {
    .forgot-brand-panel,
    .forgot-form-panel {
        padding: 1.1rem;
    }

    .forgot-step {
        font-size: 0.62rem;
    }
}
