/* Pathline auth — split editorial + form */
:root {
    --pl-bg: #ffffff;
    --pl-text: #0e0e0e;
    --pl-muted: #6f6f6f;
    --pl-muted-2: #949494;
    --pl-border: #e4e4e4;
    --pl-border-strong: #d4d4d4;
    --pl-green: #008556;
    --pl-green-soft: #e6f4ec;
    --pl-green-text: #007a4d;
    --pl-blue: #1774ff;
    --pl-red: #b42318;
    --pl-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --pl-auth-brand: #0a0a0a;
    --pl-auth-brand-muted: rgba(255, 255, 255, 0.52);
    --pl-auth-brand-faint: rgba(255, 255, 255, 0.07);
}

html {
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body.pl-auth {
    font-family: var(--pl-font);
    font-size: 14px;
    color: var(--pl-text);
    background: var(--pl-bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Page shell ── */
.pl-auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(280px, 42%) 1fr;
}

.pl-auth-panel {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--pl-bg);
}

.pl-auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px 32px;
}

/* ── Brand panel ── */
.pl-auth-brand {
    position: relative;
    overflow: hidden;
    background: var(--pl-auth-brand);
    color: #fff;
}

.pl-auth-paths {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pl-auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(32px, 5vw, 56px) clamp(28px, 4vw, 48px);
}

.pl-auth-brand-logo {
    display: block;
    line-height: 0;
    text-decoration: none;
    opacity: 0;
    animation: pl-auth-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.pl-auth-brand-logo:hover {
    opacity: 0.88;
}

.pl-auth-brand-logo img {
    display: block;
    height: 28px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    filter: invert(1);
}

.pl-auth-brand-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0;
    max-width: 340px;
}

.pl-auth-brand-eyebrow {
    margin: 0 0 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pl-green);
    opacity: 0;
    animation: pl-auth-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

.pl-auth-brand-headline {
    margin: 0 0 18px;
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: #fff;
    opacity: 0;
    animation: pl-auth-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

.pl-auth-path-hub {
    display: inline-block;
    vertical-align: -0.1em;
    width: 0.20em;
    height: 0.20em;
    margin-left: 0.04em;
    transform: translate(-6px, -3px);
    border-radius: 50%;
    background: rgba(200, 130, 255, 1);
    box-shadow: 0 0 6px rgba(200, 130, 255, 0.55);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.pl-auth-brand-sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--pl-auth-brand-muted);
    opacity: 0;
    animation: pl-auth-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}

.pl-auth-brand-products {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    opacity: 0;
    animation: pl-auth-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards;
}

.pl-auth-brand-products li {
    padding: 6px 10px;
    border: 1px solid var(--pl-auth-brand-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.pl-auth-brand-products li:first-child {
    border-color: rgba(0, 133, 86, 0.45);
    color: rgba(255, 255, 255, 0.92);
}

/* ── Shared header (logo + welcome) ── */
.pl-auth-header {
    margin-bottom: 32px;
}

.pl-auth-welcome-head {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pl-auth-welcome {
    margin: 14px 0 0;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--pl-text);
}

.pl-auth-welcome-head .pl-auth-logo {
    display: none;
    margin: 0 auto 0;
}

@media (min-width: 861px) {
    .pl-auth-header .pl-auth-welcome {
        margin-top: 0;
    }
}

.pl-auth-logo {
    display: block;
    line-height: 0;
    margin-bottom: 0;
    text-decoration: none;
}

.pl-auth-logo:hover {
    opacity: 0.85;
}

.pl-auth-logo img {
    display: block;
    height: 26px;
    width: auto;
    max-width: 160px;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
}

.pl-auth-card,
.auth-container {
    width: 100%;
    max-width: 380px;
    opacity: 0;
    animation: pl-auth-rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.pl-auth-card .auth-header {
    margin-bottom: 28px;
    text-align: left;
}

.pl-auth-card .auth-header--center {
    text-align: center;
}

.pl-auth-login .switch-text {
    text-align: center;
}

.pl-auth-card .auth-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.025em;
    color: var(--pl-text);
}

.pl-auth-card .auth-header p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--pl-muted);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pl-muted);
}

.pl-auth-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pl-auth-field-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pl-muted);
    padding: 2px 7px;
    border: 1px solid var(--pl-border-strong);
    border-radius: 999px;
    line-height: 1.3;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 0 11px;
    border: none;
    border-bottom: 1px solid var(--pl-border-strong);
    border-radius: 0;
    background: transparent;
    color: var(--pl-text);
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    outline: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input::placeholder {
    color: var(--pl-muted-2);
}

.form-group input:focus,
.form-group select:focus {
    border-bottom-color: var(--pl-blue);
    box-shadow: 0 1px 0 0 var(--pl-blue);
}

.form-group input.pl-auth-input--locked,
.form-group input.pl-auth-input--locked:focus {
    color: var(--pl-muted);
    cursor: default;
    border-bottom-color: var(--pl-border);
    box-shadow: none;
}

.form-group select {
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23949494' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0 center;
    background-repeat: no-repeat;
    background-size: 16px;
}

/* OTP-style code fields */
.form-group--code input {
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.35em;
    text-align: center;
    padding: 16px 0;
    font-variant-numeric: tabular-nums;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.confirmation-modal-checkbox {
    margin-bottom: 6px;
    padding: 12px 14px;
    background: var(--pl-bg);
    border: 1px solid var(--pl-border-strong);
    transition: border-color 0.15s ease;
    cursor: pointer;
}

.confirmation-modal-checkbox:hover {
    border-color: var(--pl-border);
}

.confirmation-modal-checkbox input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    border: 1px solid var(--pl-border-strong) !important;
    border-radius: 0 !important;
    background: var(--pl-bg) !important;
    cursor: pointer !important;
    margin: 0 !important;
    vertical-align: middle !important;
}

.confirmation-modal-checkbox input[type="checkbox"]:checked {
    background: var(--pl-text) !important;
    border-color: var(--pl-text) !important;
}

.confirmation-modal-checkbox input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -60%) rotate(45deg) !important;
    width: 5px !important;
    height: 9px !important;
    border: solid #fff !important;
    border-width: 0 2px 2px 0 !important;
}

.confirmation-modal-checkbox label {
    color: var(--pl-text);
    font-size: 13px;
    font-weight: 400;
    margin-left: 8px;
    cursor: pointer;
}

.submit-button {
    width: 100%;
    margin-top: 10px;
    padding: 18px 24px;
    border: none;
    background: var(--pl-text);
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.2s ease, opacity 0.15s ease, transform 0.15s ease;
}

a.submit-button {
    display: block;
    text-decoration: none;
}

a.submit-button:hover,
a.submit-button:focus {
    color: #fff;
    text-decoration: none;
}

.submit-button::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--pl-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.submit-button:hover:not(:disabled)::before {
    transform: scaleX(1);
}

.submit-button:hover:not(:disabled) {
    background: #1a1a1a;
}

.submit-button:active:not(:disabled) {
    transform: scale(0.995);
}

.submit-button:disabled,
.submit-button.loading {
    opacity: 0.55;
    cursor: default;
}

.submit-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.submit-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: pl-auth-spin 0.8s linear infinite;
}

@keyframes pl-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pl-auth-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.switch-text {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pl-muted);
}

.switch-text a,
.terms-link {
    color: var(--pl-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 400;
    margin-left: 4px;
    transition: color 0.15s ease;
}

.switch-text a:hover,
.terms-link:hover {
    color: var(--pl-green-text);
}

.terms-text {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--pl-muted);
}

.error,
.success {
    margin: 0 0 20px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    border: 1px solid var(--pl-border-strong);
    animation: pl-auth-rise 0.35s ease;
}

.error {
    color: var(--pl-red);
    background: #fef2f2;
    border-color: #fecaca;
}

.success {
    color: var(--pl-green-text);
    background: var(--pl-green-soft);
    border-color: #bbf7d0;
}

#message:empty {
    display: none !important;
}

.pl-auth-footer,
.auth-footer {
    flex-shrink: 0;
    padding: 16px 32px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--pl-muted-2);
    border-top: 1px solid var(--pl-border);
}

.pl-auth-footer a,
.auth-footer a {
    color: var(--pl-muted);
    text-decoration: none;
}

.pl-auth-footer a:hover,
.auth-footer a:hover {
    color: var(--pl-text);
    text-decoration: underline;
}

.auth-footer-sep {
    margin: 0 8px;
    color: var(--pl-border);
}

/* ── Loading overlay ── */
.loading-overlay,
.pl-auth-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--pl-bg);
    color: var(--pl-text);
}

.loading-overlay-content {
    text-align: center;
    max-width: 320px;
    padding: 0 24px;
}

.loading-overlay-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.025em;
    color: var(--pl-text);
}

.loading-overlay-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--pl-muted);
}

.pl-auth-loading-path {
    width: 120px;
    height: 2px;
    margin: 0 auto;
    background: var(--pl-border);
    overflow: hidden;
    position: relative;
}

.pl-auth-loading-path::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 40%;
    background: var(--pl-green);
    animation: pl-auth-loading-sweep 1.1s ease-in-out infinite;
}

@keyframes pl-auth-loading-sweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(350%);
    }
}

.pl-auth-invite-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pl-auth-team-invite-banner {
    width: 100%;
    max-width: 100%;
    margin-bottom: 18px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--pl-border);
    background: transparent;
}

.pl-auth-team-invite-eyebrow {
    margin: 0 0 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pl-green-text);
}

.pl-auth-team-invite-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--pl-text);
    overflow-wrap: anywhere;
}

.pl-auth-team-invite-title strong {
    font-weight: 600;
}

.pl-auth-team-invite-desc {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--pl-muted);
}

.pl-auth-team-invite-number-label {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--pl-muted);
}

.pl-auth-team-invite-number {
    margin: 0;
    font-size: inherit;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--pl-text);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.pl-auth-team-invite-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pl-muted);
}

.pl-auth-invite-copy {
    text-align: center;
}

.pl-auth-invite-copy p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--pl-muted);
}

#inviteOnlyMessage .auth-header {
    margin-bottom: 0;
}

.pl-auth-invite-actions .submit-button,
.pl-auth-invite-actions .pl-auth-btn-secondary {
    width: 100%;
    max-width: 280px;
}

.pl-auth-btn-secondary {
    width: 100%;
    padding: 18px 24px;
    border: 1px solid var(--pl-border-strong);
    background: transparent;
    color: var(--pl-text);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.pl-auth-btn-secondary:hover {
    background: #fafafa;
    border-color: var(--pl-text);
}

.pl-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(14, 14, 14, 0.18);
}

.pl-auth-modal-panel {
    width: 100%;
    max-width: 360px;
    padding: 24px;
    background: var(--pl-bg);
    border: 1px solid var(--pl-border-strong);
}

.pl-auth-modal-panel h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--pl-text);
}

.pl-auth-modal-panel p {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--pl-muted);
}

.pl-auth-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.confirmation-modal-checkbox {
    position: relative;
}

.confirmation-modal-checkbox input[type="checkbox"] {
    position: relative !important;
}

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

    .pl-auth-brand {
        display: none;
    }

    .pl-auth-welcome-head .pl-auth-logo {
        display: block;
        margin: 0;
    }

    .pl-auth-welcome-head .pl-auth-logo img {
        margin-left: 0;
        margin-right: auto;
    }

    .pl-auth-welcome-head {
        align-items: flex-start;
        text-align: left;
    }

    .pl-auth-card .pl-auth-welcome-head.auth-header--center {
        text-align: left;
    }

    .pl-auth-main {
        padding: 40px 24px 28px;
    }

    .pl-auth-main::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--pl-green), var(--pl-text));
        z-index: 10;
    }
}

@media (max-width: 480px) {
    .pl-auth-main {
        padding: 36px 20px 24px;
    }

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

    .pl-auth-footer,
    .auth-footer {
        padding: 16px 20px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pl-auth-brand-logo,
    .pl-auth-brand-eyebrow,
    .pl-auth-brand-headline,
    .pl-auth-brand-sub,
    .pl-auth-brand-products,
    .pl-auth-card,
    .error,
    .success {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .pl-auth-loading-path::after {
        animation: none;
        width: 100%;
    }
}
