/* The authentication shell separates brand context from the secure login form. */
.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(390px, 0.92fr) minmax(500px, 1.08fr);
    background: var(--surface);
}

.login-showcase {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    padding: 42px clamp(36px, 5vw, 78px);
    overflow: hidden;
    color: #d8efed;
    background:
        radial-gradient(circle at 84% 14%, rgba(51, 201, 198, 0.22), transparent 29%),
        radial-gradient(circle at 8% 86%, rgba(45, 118, 139, 0.32), transparent 31%),
        linear-gradient(148deg, #092a2f 0%, #0b3d43 52%, #075a5c 100%);
}

.login-showcase::after {
    position: absolute;
    right: -120px;
    bottom: -150px;
    width: 410px;
    height: 410px;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 140px rgba(255, 255, 255, 0.018);
}

.login-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
}

.login-brand .brand-mark {
    color: #082e32;
    background: #7ee0dc;
    box-shadow: 0 10px 28px rgba(8, 24, 27, 0.26);
}

.login-brand .brand-copy strong {
    color: #fff;
    font-size: 19px;
}

.login-brand .brand-copy small {
    color: #7ee0dc;
}

/* The showcase copy describes the Client trading experience. */
.showcase-content {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    margin: auto 0;
    padding: 72px 0 58px;
}

.showcase-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    color: #a8eeeb;
    background: rgba(117, 226, 221, 0.09);
    border: 1px solid rgba(127, 229, 225, 0.16);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.55px;
    text-transform: uppercase;
}

.showcase-content h1 {
    margin: 24px 0 18px;
    color: #fff;
    font-size: clamp(38px, 4.5vw, 62px);
    line-height: 1.04;
    letter-spacing: -2.3px;
}

.showcase-content > p {
    max-width: 520px;
    margin-bottom: 31px;
    color: #a9c9c8;
    font-size: 15px;
    line-height: 1.75;
}

.portal-preview-grid {
    display: grid;
    gap: 10px;
}

.portal-preview {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 13px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    backdrop-filter: blur(12px);
}

.portal-preview.active {
    background: rgba(110, 221, 216, 0.09);
    border-color: rgba(126, 224, 220, 0.2);
}

.portal-preview-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #8ce4df;
    background: rgba(126, 224, 220, 0.1);
    border-radius: 11px;
}

.portal-preview div {
    display: flex;
    flex-direction: column;
}

.portal-preview strong {
    color: #edf9f8;
    font-size: 12px;
}

.portal-preview small {
    margin-top: 3px;
    color: #96b8b7;
    font-size: 10px;
    line-height: 1.5;
}

.showcase-security {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    color: #9fc3c1;
}

.showcase-security > i {
    display: grid;
    width: 33px;
    height: 33px;
    place-items: center;
    color: #81ddd9;
    background: rgba(126, 224, 220, 0.08);
    border-radius: 9px;
}

.showcase-security span {
    display: flex;
    flex-direction: column;
}

.showcase-security strong {
    color: #dff4f2;
    font-size: 10px;
}

.showcase-security small {
    margin-top: 2px;
    color: #86aaa8;
    font-size: 8.5px;
}

/* The right panel centers authentication without a separate utility toolbar. */
.login-main {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 52px clamp(25px, 7vw, 110px);
    padding-bottom: 100px;
    background: var(--surface);
}

.auth-card {
    width: min(560px, 100%);
}

/* The compact switcher keeps Login and Register on one familiar access route. */
.auth-tab-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 27px;
    padding: 4px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.auth-tab-switcher button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.auth-tab-switcher button:hover {
    color: var(--primary);
}

.auth-tab-switcher button.active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: 0 3px 12px rgba(12, 42, 47, 0.09);
}

.auth-tab-switcher button:focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), 0.18);
    outline-offset: 1px;
}

/* Hidden tab panels leave the inactive form out of both layout and keyboard flow. */
.auth-panel[hidden] {
    display: none !important;
}

.auth-panel.active {
    animation: reveal-auth-panel 180ms ease-out;
}

@keyframes reveal-auth-panel {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-heading .eyebrow {
    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.auth-heading h2 {
    margin: 10px 0 8px;
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -1.25px;
}

.auth-heading p {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.auth-field {
    display: grid;
    gap: 7px;
}

.auth-field > span:first-child {
    color: var(--text);
    font-size: 9px;
    font-weight: 800;
}

.auth-field > span:first-child small {
    margin-left: 4px;
    color: var(--text-faint);
    font-size: 10px;
    font-weight: 600;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    height: 50px;
    align-items: center;
}

.auth-input-wrap > i {
    position: absolute;
    left: 15px;
    color: var(--text-faint);
    font-size: 12px;
}

.auth-input-wrap input,
.auth-input-wrap select {
    width: 100%;
    height: 100%;
    padding: 0 44px 0 42px;
    color: var(--text-strong);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    outline: none;
    font-size: 11px;
    transition: border var(--transition), box-shadow var(--transition);
}

.auth-input-wrap:not(:has(.password-toggle)) input {
    padding-right: 14px;
}

.auth-input-wrap input:focus,
.auth-input-wrap select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.auth-input-wrap input::placeholder {
    color: var(--text-faint);
}

.password-toggle {
    position: absolute;
    right: 7px;
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    color: var(--text-faint);
    background: transparent;
    border: 0;
    border-radius: 8px;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.auth-message {
    display: none;
    margin: -2px 0 0;
    padding: 9px 11px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid rgba(216, 75, 88, 0.18);
    border-radius: 9px;
    font-size: 9px;
    font-weight: 700;
}

.auth-message.visible {
    display: block;
}

/* Successful registration feedback confirms queue entry without implying immediate access. */
.auth-message.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(26, 142, 106, 0.2);
}

/* Pending review uses a looping hourglass instead of a misleading completion percentage. */
.auth-message.visible.pending-review {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(183, 120, 21, 0.22);
}

.auth-message.pending-review i {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 14px;
    animation: turn-review-hourglass 2.4s ease-in-out infinite;
}

/* The pending title and explanation use separate lines for a professional status layout. */
.pending-review-copy {
    display: grid;
    gap: 2px;
    line-height: 1.45;
}

.pending-review-copy strong {
    color: var(--text-strong);
    font-size: 12px;
}

.pending-review-copy > span {
    color: var(--text-muted);
    font-weight: 600;
}

@keyframes turn-review-hourglass {
    0%, 38% {
        transform: rotate(0deg);
    }

    52%, 88% {
        transform: rotate(180deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Reduced-motion users keep the hourglass state without the flipping animation. */
@media (prefers-reduced-motion: reduce) {
    .auth-message.pending-review i {
        animation: none;
    }
}

/* Registration details use two compact columns on wider authentication panels. */
.registration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.registration-consent {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 9px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.55;
}

.registration-consent input {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    accent-color: var(--primary);
}

.auth-submit {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
    padding: 0 17px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #0ba0a2);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.2);
    font-size: 10px;
    font-weight: 800;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 13px 28px rgba(var(--primary-rgb), 0.26);
}

.auth-submit:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.auth-footnote {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 22px;
    padding-top: 18px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-size: 8.5px;
    line-height: 1.5;
}

.auth-footnote i {
    color: var(--success);
}

/* Local test accounts appear as concise selectable identity cards inside the shared modal. */
.test-client-list {
    display: grid;
    gap: 8px;
    max-height: min(440px, 55vh);
    overflow-y: auto;
    padding: 2px;
    text-align: left;
}

.test-client-option {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.test-client-option:hover,
.test-client-option:has(input:checked) {
    background: var(--primary-soft);
    border-color: rgba(var(--primary-rgb), 0.38);
}

.test-client-option:has(input:checked) {
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.08);
}

.test-client-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.test-client-option:has(input:focus-visible) {
    outline: 3px solid rgba(var(--primary-rgb), 0.2);
    outline-offset: 2px;
}

.test-client-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fff;
    background: var(--primary);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
}

.test-client-identity {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.test-client-identity strong,
.test-client-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.test-client-identity strong {
    color: var(--text-strong);
    font-size: 12px;
}

.test-client-identity small,
.test-client-metadata {
    color: var(--text-muted);
    font-size: 10.5px;
}

.test-client-metadata {
    font-weight: 700;
    white-space: nowrap;
}

.login-footer {
    position: absolute;
    bottom: 22px;
    left: 22px;
    right: 22px;
    display: grid;
    gap: 6px;
    margin: 0;
    color: var(--text-faint);
    font-size: 8px;
    line-height: 1.5;
    text-align: center;
}

.login-footer p {
    margin: 0;
}

/* Responsive authentication rules prioritize the form on smaller screens. */
@media (max-width: 920px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-showcase {
        min-height: auto;
        padding: 25px 24px;
    }

    .showcase-content,
    .showcase-security {
        display: none;
    }

    .login-main {
        min-height: calc(100vh - 92px);
        padding: 48px 22px 100px;
    }
}

@media (max-width: 520px) {
    .registration-grid {
        grid-template-columns: 1fr;
    }

    .test-client-option {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .test-client-metadata {
        grid-column: 2;
        white-space: normal;
    }

}

/* Readable authentication scale keeps labels, inputs, and security notes easy to scan. */
.showcase-kicker {
    font-size: 12px;
}

.portal-preview strong {
    font-size: 14px;
}

.portal-preview small,
.showcase-security strong {
    font-size: 12px;
}

.showcase-security small,
.auth-footnote {
    font-size: 11px;
}

.auth-heading .eyebrow,
.login-footer {
    font-size: 10.5px;
}

.auth-heading p {
    font-size: 14px;
}

.auth-field > span:first-child,
.auth-message {
    font-size: 12px;
}

.auth-input-wrap {
    height: 54px;
}

.auth-input-wrap input,
.auth-input-wrap select {
    font-size: 14px;
}

.auth-submit {
    min-height: 54px;
    font-size: 13px;
}
