:root {
    --bg: #212d36;
    --bg-deep: #1a242c;
    --panel: #28353f;
    --panel-2: #242f38;
    --teal: #1197a0;
    --teal-2: #18b2b0;
    --white: #f4f4f4;
    --muted: #aab6cf;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(17, 151, 160, 0.38);
    --input-bg: rgba(255, 255, 255, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--white);
}

body {
    min-height: 100svh;
}

.page {
    position: relative;
    width: 100%;
    height: 100svh;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    background: var(--bg);
    isolation: isolate;
}

.page::before,
.page::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
    z-index: 0;
}

.page::before {
    width: 34rem;
    height: 34rem;
    top: -12rem;
    left: -10rem;
    border: 1px solid rgba(17, 151, 160, 0.22);
    border-radius: 50%;
}

.page::after {
    width: 28rem;
    height: 28rem;
    right: -8rem;
    bottom: -8rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.vector-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: 1;
}

.vector-grid span {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.vector-grid span:nth-child(1) {
    width: 18rem;
    height: 18rem;
    left: 42%;
    top: 10%;
    border-color: rgba(17, 151, 160, 0.18);
}

.vector-grid span:nth-child(2) {
    width: 10rem;
    height: 10rem;
    left: 58%;
    top: 62%;
    border-color: rgba(255, 255, 255, 0.08);
}

.vector-grid span:nth-child(3) {
    width: 24rem;
    height: 24rem;
    left: 68%;
    top: -8%;
    border-color: rgba(17, 151, 160, 0.12);
}

.vector-grid span:nth-child(4) {
    width: 16rem;
    height: 16rem;
    left: -4rem;
    bottom: 4rem;
    border-color: rgba(255, 255, 255, 0.05);
}

.vector-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(17, 151, 160, 0.32), transparent);
    height: 1px;
    width: 26rem;
    left: 8%;
    bottom: 18%;
}

.vector-line.line-2 {
    width: 18rem;
    left: auto;
    right: 7%;
    top: 18%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
}

.left-side,
.right-side {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow: hidden;
}

.left-side {
    padding: clamp(24px, 4vw, 48px) clamp(24px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--panel);
    object-fit: cover;
    flex-shrink: 0;
}

.brand-text h3 {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--white);
}

.brand-text p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
}

.hero {
    max-width: 600px;
    padding: 1.2rem 0;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--teal-2);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 18px;
}

.tag::before {
    content: "";
    width: 38px;
    height: 1px;
    background: var(--teal);
}

.hero h1 {
    font-size: clamp(2.2rem, 4vw, 4.9rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.hero h1 span {
    color: var(--teal-2);
}

.hero p {
    margin-top: 18px;
    max-width: 520px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.info-row {
    display: flex;
    gap: 28px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.info-box {
    min-width: 120px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.info-box strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--white);
}

.info-box span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.bottom-note {
    font-size: 0.84rem;
    color: rgba(244, 244, 244, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
    max-width: 460px;
}

.right-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 3vw, 40px);
    background: var(--panel-2);
}

.form-wrap {
    width: 100%;
    max-width: 430px;
    padding: 0.5rem 0;
}

.form-wrap h2 {
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 800;
    margin-bottom: 10px;
}

.form-wrap .sub {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 380px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
}

.input {
    width: 100%;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--input-bg);
    padding: 0 16px;
    color: var(--white);
    font-size: 0.98rem;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.36);
}

.input:focus {
    border-color: var(--teal);
    background: rgba(255, 255, 255, 0.05);
}

.input.is-invalid {
    border-color: #e74c3c;
}

.error-msg {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #e74c3c;
}

.meta {
    margin: 10px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.92rem;
    user-select: none;
}

.remember {
    padding: 0;
    border: none;
    background: transparent;
}

.remember:hover {
    border: none;
    background: transparent;
    box-shadow: none;
}

/* Checkbox visuals: app.css (.remember, .pms-check) — loaded on login page */

.link {
    color: var(--teal-2);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.btn {
    width: 100%;
    height: 56px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--teal), var(--teal-2));
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.2s ease;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 980px) {
    .page { grid-template-columns: 1fr; }

    .vector-grid span:nth-child(3),
    .vector-grid span:nth-child(4) { display: none; }
}

@media (max-width: 640px) {
    html, body { overflow: hidden; }
    .page { height: 100svh; }

    .right-side  { padding: 14px 16px 18px; }
    .form-wrap h2 { font-size: 1.7rem; }
    .form-wrap .sub { margin-bottom: 20px; font-size: 0.92rem; line-height: 1.55; }

    .field  { margin-bottom: 12px; }
    .input  { height: 50px; border-radius: 12px; }
    .meta   { margin: 8px 0 16px; }
    .btn    { height: 52px; border-radius: 14px; }

    .vector-line,
    .vector-line.line-2 { display: none; }
}

@media (max-height: 760px) and (min-width: 981px) {
    .left-side  { padding-top: 28px; padding-bottom: 22px; }
    .hero p     { margin-top: 14px; line-height: 1.6; }
    .info-row   { margin-top: 18px; }
    .info-box   { padding-top: 10px; }
    .right-side { padding-top: 20px; padding-bottom: 20px; }
    .form-wrap .sub { margin-bottom: 18px; }
    .field      { margin-bottom: 12px; }
    .signup     { margin-top: 16px; }
}

/* ── Theme toggle: fixed wrapper so .theme-pill stays position:relative inside ── */
.login-theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    left: auto;
    z-index: 100;
    pointer-events: none;
}

.login-theme-toggle .theme-pill {
    pointer-events: auto;
}

.theme-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.theme-pill-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease;
    pointer-events: none;
}

.theme-pill[data-active="light"] .theme-pill-slider {
    transform: translateX(32px);
}

.theme-pill-btn {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.theme-pill-btn.active {
    color: #1e293b;
}

/* ── Light mode ── */
[data-theme="light"] {
    --bg: #e8eaef;
    --bg-deep: #dfe2e8;
    --panel: #f5f6f8;
    --panel-2: #eff1f4;
    --teal: #0d6e75;
    --teal-2: #0f7f7d;
    --white: #374151;
    --muted: #6b7280;
    --line: rgba(51, 65, 85, 0.12);
    --line-strong: rgba(13, 110, 117, 0.2);
    --input-bg: #fafbfc;
}

[data-theme="light"] .page {
    background: var(--bg);
}

[data-theme="light"] .page::before,
[data-theme="light"] .page::after,
[data-theme="light"] .vector-grid {
    display: none;
}

[data-theme="light"] .left-side {
    border-right-color: var(--line);
}

[data-theme="light"] .right-side {
    background: var(--panel-2);
}

[data-theme="light"] .brand-logo {
    background: var(--panel);
    border-color: var(--line);
}

[data-theme="light"] .hero h1 span,
[data-theme="light"] .tag {
    color: var(--teal);
}

[data-theme="light"] .info-box {
    border-top-color: var(--line);
}

[data-theme="light"] .bottom-note {
    color: var(--muted);
    border-top-color: var(--line);
}

[data-theme="light"] .input::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

[data-theme="light"] .input:focus {
    border-color: var(--teal);
    background: #fff;
}

[data-theme="light"] .remember input {
    border-color: var(--line);
    background: #fff;
}

[data-theme="light"] .btn {
    background: var(--teal);
}

[data-theme="light"] .login-theme-toggle .theme-pill {
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

@media (max-width: 640px) {
    .login-theme-toggle {
        top: 12px;
        right: 12px;
    }
}
