/* RP Pulse Login - dark split experience */

@keyframes pulse-wave {
    0% {
        opacity: 0;
        transform: scale(0.62);
    }
    38% {
        opacity: 0.48;
    }
    100% {
        opacity: 0;
        transform: scale(1.62);
    }
}

@keyframes pulse-line-flow {
    0%, 100% {
        opacity: 0.28;
        transform: translate3d(-4%, 0, 0) rotate(-10deg);
    }
    50% {
        opacity: 0.68;
        transform: translate3d(5%, -1%, 0) rotate(-10deg);
    }
}

@keyframes brand-scan {
    0%, 100% {
        opacity: 0.12;
        transform: translateX(-34%) rotate(-18deg);
    }
    50% {
        opacity: 0.42;
        transform: translateX(34%) rotate(-18deg);
    }
}

@keyframes logo-breathe {
    0%, 100% {
        filter:
            drop-shadow(0 22px 42px rgba(0, 0, 0, 0.34))
            drop-shadow(0 0 28px rgba(147, 197, 253, 0.2));
        transform: translateY(0) scale(1);
    }
    50% {
        filter:
            drop-shadow(0 28px 52px rgba(0, 0, 0, 0.4))
            drop-shadow(0 0 46px rgba(147, 197, 253, 0.38));
        transform: translateY(-4px) scale(1.018);
    }
}

@keyframes button-glow {
    0%, 100% {
        box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
    }
    50% {
        box-shadow: 0 18px 42px rgba(59, 130, 246, 0.42);
    }
}

@keyframes input-focus-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.24);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(96, 165, 250, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
    }
}

.login-pulse-shell {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow-x: clip;
    background:
        radial-gradient(circle at 24% 30%, rgba(59, 130, 246, 0.22), transparent 30%),
        radial-gradient(circle at 78% 48%, rgba(14, 165, 233, 0.1), transparent 28%),
        linear-gradient(110deg, #071226 0%, #07142c 48%, #0a1021 48%, #111827 100%);
}

.login-pulse-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 78%);
}

.login-pulse-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 70%, rgba(34, 211, 238, 0.12), transparent 22%),
        linear-gradient(90deg, rgba(3, 11, 41, 0.1), rgba(3, 11, 41, 0.52) 50%, rgba(3, 11, 41, 0.18));
}

.login-stage {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 1fr);
    min-height: 100vh;
}

.login-brand-panel,
.login-form-panel {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 5rem);
}

.login-brand-panel {
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 46%, rgba(59, 130, 246, 0.2), transparent 34%),
        radial-gradient(circle at 34% 74%, rgba(14, 165, 233, 0.13), transparent 28%);
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    top: -12%;
    bottom: -12%;
    left: 12%;
    width: 18rem;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(191, 219, 254, 0.18), rgba(34, 211, 238, 0.14), transparent);
    filter: blur(18px);
    animation: brand-scan 7s ease-in-out infinite;
}

.login-form-panel {
    background:
        radial-gradient(circle at 24% 16%, rgba(59, 130, 246, 0.08), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 1px 0 0 rgba(15, 23, 42, 0.08);
}

.pulse-wave {
    position: absolute;
    border: 1px solid rgba(191, 219, 254, 0.34);
    border-radius: 9999px;
    background:
        radial-gradient(circle, rgba(96, 165, 250, 0.22) 0%, rgba(37, 99, 235, 0.1) 46%, transparent 70%);
    pointer-events: none;
    animation: pulse-wave 4.4s ease-out infinite;
}

.pulse-wave-1 {
    width: 28rem;
    height: 28rem;
    top: 14%;
    left: 10%;
}

.pulse-wave-2 {
    width: 34rem;
    height: 34rem;
    right: 4%;
    bottom: 6%;
    animation-delay: 1.1s;
}

.pulse-wave-3 {
    width: 18rem;
    height: 18rem;
    left: 34%;
    bottom: 16%;
    animation-delay: 2.1s;
}

.pulse-wave-4 {
    width: 24rem;
    height: 24rem;
    top: 34%;
    right: 28%;
    animation-delay: 3s;
}

.pulse-wave-5 {
    width: 16rem;
    height: 16rem;
    left: 17%;
    bottom: 10%;
    animation-delay: 1.7s;
}

.pulse-line {
    position: absolute;
    width: 70rem;
    height: 14rem;
    border-radius: 9999px;
    background:
        linear-gradient(90deg, transparent 0%, rgba(147, 197, 253, 0.18) 30%, rgba(59, 130, 246, 0.34) 50%, rgba(34, 211, 238, 0.18) 70%, transparent 100%);
    filter: blur(20px);
    pointer-events: none;
    animation: pulse-line-flow 8s ease-in-out infinite;
}

.pulse-line-1 {
    top: 13%;
    left: -10%;
}

.pulse-line-2 {
    right: -18%;
    bottom: 10%;
    animation-delay: 2.4s;
}

.login-pulse-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(72px);
    opacity: 0.46;
    pointer-events: none;
    transition: transform 180ms ease-out;
}

.login-pulse-blob-primary {
    width: 28rem;
    height: 28rem;
    top: 12%;
    left: 14%;
    background: rgba(59, 130, 246, 0.36);
}

.login-pulse-blob-secondary {
    width: 24rem;
    height: 24rem;
    right: 12%;
    bottom: 12%;
    background: rgba(14, 165, 233, 0.18);
}

.login-brand-hero,
.login-brand-copy,
.login-form-container {
    position: relative;
    z-index: 2;
}

.login-brand-panel {
    flex-direction: column;
    text-align: center;
}

.login-brand-hero {
    margin-bottom: 2rem;
}

.login-brand-mark {
    display: block;
    width: min(44rem, 76vw);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    animation: logo-breathe 5.4s ease-in-out infinite;
}

.login-brand-copy {
    max-width: 34rem;
    margin: 0 auto;
    color: rgba(219, 234, 254, 0.72);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.7;
}

.login-form-container {
    width: min(100%, 28rem);
}

.login-form-container-wide {
    width: min(100%, 32rem);
}

.login-message-zone > * {
    max-width: 100%;
}

.login-heading {
    margin-bottom: 1.7rem;
    text-align: center;
}

.login-heading h1 {
    color: #0f172a;
    font-size: clamp(1.75rem, 2.6vw, 2.35rem);
    font-weight: 800;
    line-height: 1.1;
}

.login-heading p {
    margin-top: 0.55rem;
    color: #64748b;
    font-size: 0.9rem;
}

.login-panel {
    width: 100%;
}

.login-label {
    display: block;
    margin-bottom: 0.45rem;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}

.login-input {
    display: block;
    width: 100%;
    height: 3.1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0 0.95rem;
    color: #0f172a;
    font-size: 0.92rem;
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 1px 2px rgba(15, 23, 42, 0.08);
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position:
        calc(100% - 1.15rem) 50%,
        calc(100% - 0.82rem) 50%;
    background-size:
        0.36rem 0.36rem,
        0.36rem 0.36rem;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
}

.form-input {
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input:focus {
    border-color: rgba(96, 165, 250, 0.74);
    background: #ffffff;
    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.18),
        0 12px 26px rgba(37, 99, 235, 0.1);
    animation: input-focus-glow 0.6s ease-out;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 3.15rem;
    border-radius: 0.75rem;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.28);
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    animation: button-glow 2.8s ease-in-out infinite;
}

.btn-submit:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.95);
    outline-offset: 3px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    background: #1d4ed8;
}

.login-action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 3.15rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #ffffff;
    color: #1e40af;
    font-size: 0.94rem;
    font-weight: 800;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.btn-secondary:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-2px);
}

.login-panel .btn-submit:disabled,
.login-panel .btn-submit.opacity-50 {
    opacity: 0.78;
    cursor: not-allowed;
    background: #2563eb;
    color: rgba(255, 255, 255, 0.9);
    animation: none;
    transform: none;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-remember-checkbox {
    width: 2.75rem !important;
    height: 1.5rem !important;
    border-color: #cbd5e1 !important;
    background-color: #e2e8f0 !important;
    transition: all 0.3s ease;
}

.auth-remember-checkbox:checked {
    background-color: #2563eb !important;
    border-color: #60a5fa !important;
}

.auth-remember-checkbox:hover {
    transform: scale(1.05);
}

.login-toggle-knob {
    left: 0.125rem;
    top: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
    transition: transform 300ms ease, background-color 300ms ease;
}

.auth-remember-checkbox:checked + .login-toggle-knob {
    transform: translateX(1.25rem);
    background: #ffffff;
}

.login-option-label {
    cursor: pointer;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 650;
}

.login-terms {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.45;
}

.login-terms input {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    margin-top: 0.15rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    accent-color: #2563eb;
}

.login-terms a,
.login-alt-link a {
    color: #2563eb;
    font-weight: 800;
    transition: color 0.2s ease;
}

.login-terms a:hover,
.login-alt-link a:hover {
    color: #1e40af;
}

a.forgot-password {
    position: relative;
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

a.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #60a5fa;
    transition: width 0.3s ease;
}

a.forgot-password:hover {
    color: #1e40af;
}

a.forgot-password:hover::after {
    width: 100%;
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1.35rem;
    border-top: 1px solid #e2e8f0;
    padding-top: 1rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 650;
}

.login-security-note span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #22c55e;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.45);
}

.login-alt-link {
    margin-top: 1rem;
    color: #475569;
    font-size: 0.84rem;
    font-weight: 650;
    text-align: center;
}

.login-footnote {
    margin-top: 1.6rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.login-footnote p + p {
    margin-top: 0.25rem;
    color: #cbd5e1;
    font-weight: 500;
}

.login-footnote a {
    color: #475569;
    font-weight: 700;
    transition: color 0.2s ease;
}

.login-footnote a:hover {
    color: #2563eb;
}

@media (max-width: 900px) {
    .login-pulse-shell,
    .login-stage,
    .login-brand-panel,
    .login-form-panel {
        max-width: 100vw;
        overflow-x: hidden;
    }

    .login-stage {
        display: flex;
        min-height: 100svh;
        flex-direction: column;
    }

    .login-brand-panel,
    .login-form-panel {
        align-items: center;
        box-sizing: border-box;
        justify-content: center;
        width: 100%;
        min-height: auto;
        padding: 1.4rem 1rem;
    }

    .login-brand-panel {
        min-height: 10rem;
        padding-top: 1.8rem;
        padding-bottom: 1.8rem;
    }

    .login-form-panel {
        flex: 1;
        align-items: flex-start;
        padding: 1.9rem 1.25rem 2rem;
        box-shadow: none;
    }

    .login-brand-mark {
        width: min(20rem, 84vw);
        margin: 0 auto;
    }

    .login-brand-copy {
        display: none;
    }

    .login-form-container {
        width: min(100%, calc(100vw - 2rem), 22rem);
        margin: 0 auto;
    }

    .login-form-container-wide {
        width: min(100%, calc(100vw - 2rem), 24rem);
    }

    .login-heading {
        margin-bottom: 1.45rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .login-form-container {
        width: min(18rem, calc(100vw - 2rem));
    }

    .login-form-container-wide {
        width: min(19rem, calc(100vw - 2rem));
    }

    .login-brand-mark {
        width: min(18rem, 82vw);
    }

    .login-heading h1 {
        font-size: 1.55rem;
    }

    .login-heading p {
        font-size: 0.82rem;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.8rem;
    }

    .login-action-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .login-brand-panel,
    .login-form-panel {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .login-brand-panel {
        min-height: 9.25rem;
    }

    .login-brand-mark {
        width: min(17rem, 82vw);
    }

    .login-form-panel {
        padding-top: 1.6rem;
    }

    .login-heading h1 {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-wave,
    .pulse-line,
    .btn-submit {
        animation: none;
    }

    .login-pulse-blob {
        transition: none;
    }
}
