:root {
    --login-blue: #0016fd;
    --login-deep: #00018d;
    --login-orange: #fb5401;
    --login-cyan: #09cae2;
    --login-text: #ffffff;
    --login-muted: rgba(255,255,255,.74);
    --login-card: rgba(255,255,255,.92);
    --login-card-dark: rgba(8,12,38,.72);
}

* { box-sizing: border-box; }

body.pd-login-page-v2 {
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--login-text);
    background: #00018d;
}

.pd-login-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    background: #00018d;
}

.pd-login-bg {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 82% 10%, rgba(251,84,1,.48), transparent 34%),
        radial-gradient(circle at 14% 0%, rgba(9,202,226,.18), transparent 28%),
        linear-gradient(135deg, rgba(0,1,141,.96) 0%, rgba(0,22,253,.78) 42%, rgba(7,20,45,.92) 100%);
}

.pd-login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .16;
}

.pd-login-layout {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 44px));
    min-height: 100svh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, .82fr);
    align-items: center;
    gap: clamp(28px, 5vw, 64px);
    padding: clamp(28px, 5vh, 54px) 0;
}

.pd-login-hero {
    display: grid;
    gap: 22px;
    max-width: 650px;
}

.pd-login-logo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pd-login-logo-main {
    width: clamp(178px, 24vw, 260px);
    height: auto;
    filter: drop-shadow(0 18px 34px rgba(0,0,0,.28));
}

.pd-login-powered-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.90);
    text-decoration: none;
    font-weight: 800;
    backdrop-filter: blur(14px);
}

.pd-login-powered-pill img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.pd-login-eyebrow {
    margin: 0;
    color: var(--login-cyan);
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .82rem;
}

.pd-login-title {
    margin: 0;
    font-size: clamp(2.4rem, 5.4vw, 5.2rem);
    line-height: .94;
    font-weight: 950;
    letter-spacing: 0;
    text-shadow: 0 18px 42px rgba(0,0,0,.28);
}

.pd-login-title span {
    color: var(--login-orange);
}

.pd-login-subtitle {
    max-width: 610px;
    margin: 0;
    color: var(--login-muted);
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    line-height: 1.65;
    font-weight: 650;
}

.pd-login-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pd-login-feature-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.90);
    font-weight: 800;
    font-size: .88rem;
    backdrop-filter: blur(14px);
}

.pd-login-feature-row i { color: var(--login-cyan); }

.pd-login-card-v2 {
    width: 100%;
    max-width: 480px;
    justify-self: end;
    padding: clamp(24px, 3.2vw, 34px);
    border-radius: 30px;
    background: var(--login-card);
    color: #0f172a;
    border: 1px solid rgba(255,255,255,.66);
    box-shadow: 0 34px 90px rgba(0,0,0,.32);
    backdrop-filter: blur(22px) saturate(150%);
}

.pd-login-card-header {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
}

.pd-login-card-header strong {
    color: var(--login-orange);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 950;
}

.pd-login-card-header h1 {
    margin: 0;
    color: #07142d;
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    font-weight: 950;
    letter-spacing: 0;
}

.pd-login-card-header p {
    margin: 0;
    color: #64748b;
    font-weight: 650;
    line-height: 1.5;
}

.pd-login-alert {
    display: none;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: .94rem;
    font-weight: 750;
}

.pd-login-alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.pd-login-alert-success {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #047857;
}

.pd-login-form {
    display: grid;
    gap: 16px;
}

.pd-login-group label {
    display: block;
    margin-bottom: 8px;
    color: #1f2937;
    font-weight: 850;
}

.pd-login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pd-login-input-wrap > i {
    position: absolute;
    left: 16px;
    z-index: 1;
    color: #64748b;
    font-size: 1.15rem;
}

.pd-login-input-wrap input {
    width: 100%;
    height: 56px;
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 18px;
    background: rgba(255,255,255,.86);
    color: #0f172a;
    padding: 0 16px 0 48px;
    font: inherit;
    font-weight: 700;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.pd-login-input-wrap input:focus {
    border-color: rgba(37,99,235,.55);
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.pd-login-password-toggle {
    position: absolute;
    right: 8px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.pd-login-password-toggle:hover,
.pd-login-password-toggle:focus-visible {
    background: rgba(37,99,235,.09);
    color: #2563eb;
    outline: none;
}

.pd-login-input-wrap-password input { padding-right: 56px; }

.pd-login-meta-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -2px;
}

.pd-login-meta-row a,
.pd-login-access-note a,
.pd-login-footer a {
    color: #2563eb;
    font-weight: 850;
    text-decoration: none;
}

.pd-login-meta-row a:hover,
.pd-login-access-note a:hover,
.pd-login-footer a:hover { text-decoration: underline; }

.pd-login-btn-v2 {
    width: 100%;
    height: 58px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f8df7 0%, #0f3f9f 56%, #07142d 100%);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 950;
    box-shadow: 0 18px 38px rgba(37,99,235,.30);
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.pd-login-btn-v2:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 22px 46px rgba(37,99,235,.36);
}

.pd-login-btn-v2:disabled {
    opacity: .72;
    cursor: wait;
}

.pd-login-access-note,
.pd-login-footer {
    margin-top: 18px;
    color: #64748b;
    text-align: center;
    font-size: .9rem;
    line-height: 1.55;
}

.pd-login-footer {
    padding-top: 14px;
    border-top: 1px solid rgba(15,23,42,.08);
}

@media (max-width: 980px) {
    .pd-login-layout {
        grid-template-columns: 1fr;
        align-items: start;
        width: min(760px, calc(100% - 32px));
    }
    .pd-login-card-v2 { max-width: none; justify-self: stretch; }
    .pd-login-hero { max-width: none; }
}

@media (max-width: 560px) {
    .pd-login-layout { width: min(100% - 22px, 720px); padding: 22px 0; }
    .pd-login-logo-main { width: 174px; }
    .pd-login-title { font-size: 2.25rem; }
    .pd-login-card-v2 { border-radius: 24px; padding: 22px 18px; }
    .pd-login-feature-row span { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .pd-login-video { display: none; }
    .pd-login-btn-v2 { transition: none; }
}

/* AJAX forgot-password panel */
.pd-forgot-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(37,99,235,.16);
    border-radius: 22px;
    background: rgba(255,255,255,.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 18px 44px rgba(15,23,42,.10);
    backdrop-filter: blur(18px);
}

.pd-forgot-panel[hidden] {
    display: none !important;
}

.pd-forgot-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.pd-forgot-panel__header strong {
    display: block;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 950;
}

.pd-forgot-panel__header p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.45;
}

.pd-forgot-panel__close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.78);
    color: #64748b;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.pd-forgot-panel__close:hover,
.pd-forgot-panel__close:focus-visible {
    color: #0f3f9f;
    border-color: rgba(37,99,235,.28);
    outline: none;
}

.pd-login-btn-v2--secondary {
    height: 52px;
    background: linear-gradient(135deg, #13b8a6 0%, #2563eb 58%, #07142d 100%);
    box-shadow: 0 14px 30px rgba(20,184,166,.22);
}


/* Phase 2 forgot/login switch: one card, two states */
.pd-login-card-v2.is-forgot-mode .pd-login-card-header,
.pd-login-card-v2.is-forgot-mode #login-error,
.pd-login-card-v2.is-forgot-mode #login-success,
.pd-login-card-v2.is-forgot-mode .pd-login-meta-row,
.pd-login-card-v2.is-forgot-mode .pd-login-access-note {
    display: none !important;
}
.pd-login-card-v2.is-forgot-mode {
    animation: pdLoginModeIn .28s ease both;
}
@keyframes pdLoginModeIn {
    from { opacity: .86; transform: translateY(8px) scale(.992); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.pd-login-card-v2.is-forgot-mode .pd-forgot-panel {
    margin-top: 0;
    border-radius: 26px;
    background:
        radial-gradient(circle at 92% 0%, rgba(9,202,226,.16), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.72));
    border: 1px solid rgba(37,99,235,.18);
}
.pd-login-card-v2.is-forgot-mode .pd-forgot-panel__header strong {
    font-size: 1.65rem;
    line-height: 1;
    letter-spacing: -.04em;
}
.pd-login-footer a { font-weight: 950; color: #2563eb; text-decoration: none; }
.pd-login-footer a:hover { color: #fb5401; }


/* Phase 3 login forgot state: no nested modal look */
.pd-login-card-v2.is-forgot-mode {
    max-width: 520px;
    padding: clamp(26px, 3.4vw, 40px);
}

.pd-login-card-v2.is-forgot-mode .pd-forgot-panel,
.pd-forgot-panel {
    margin-top: 0;
}

.pd-login-card-v2.is-forgot-mode .pd-forgot-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.pd-login-card-v2.is-forgot-mode .pd-forgot-panel__header {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.pd-forgot-panel__icon {
    width: 74px;
    height: 74px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    color: #fff;
    background:
        radial-gradient(circle at 24% 18%, rgba(255,255,255,.34), transparent 30%),
        linear-gradient(135deg, #13b8a6 0%, #2563eb 54%, #07142d 100%);
    box-shadow: 0 18px 42px rgba(37,99,235,.26);
}

.pd-forgot-panel__icon i { font-size: 2rem; }

.pd-login-card-v2.is-forgot-mode .pd-forgot-panel__header strong {
    color: #07142d;
    font-size: clamp(1.85rem, 3vw, 2.5rem);
    line-height: .98;
    letter-spacing: 0;
}

.pd-login-card-v2.is-forgot-mode .pd-forgot-panel__header p {
    max-width: 390px;
    margin-top: 8px;
    font-size: .96rem;
    line-height: 1.55;
}

.pd-forgot-form {
    gap: 18px;
}

.pd-forgot-panel__back {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(15,23,42,.10);
    border-radius: 17px;
    background: rgba(255,255,255,.68);
    color: #334155;
    font: inherit;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.pd-forgot-panel__back:hover,
.pd-forgot-panel__back:focus-visible {
    color: #0f3f9f;
    border-color: rgba(37,99,235,.25);
    background: rgba(37,99,235,.08);
    outline: none;
}

@media (max-width: 560px) {
    .pd-login-card-v2.is-forgot-mode .pd-forgot-panel__header {
        grid-template-columns: 1fr;
        text-align: left;
    }
}
