:root {
    color-scheme: light;
    --page-bg: var(--surface, #fafcfb);
    --page-bg-alt: var(--slate-50, #f5faf7);
    --panel: var(--surface-raised, #ffffff);
    --panel-strong: var(--surface-raised, #ffffff);
    --panel-border: var(--border-subtle, rgba(13, 51, 32, 0.08));
    --text: var(--text-color, #0f1f16);
    --text-soft: var(--muted-color, #546e5f);
    --text-muted: var(--label-color, #2c4535);
    --accent: var(--green-600, #228b4a);
    --accent-strong: var(--green-700, #1a6b3c);
    --accent-soft: var(--green-50, #f0faf4);
    --accent-warm: var(--color-warning, #e89f2f);
    --danger: var(--color-error, #e05353);
    --danger-soft: rgba(224, 83, 83, 0.1);
    --success: var(--color-success, #2da05a);
    --success-soft: rgba(45, 160, 90, 0.12);
    --shadow-lg: 0 16px 48px rgba(13, 51, 32, 0.14);
    --shadow-md: 0 6px 24px rgba(13, 51, 32, 0.1);
    --radius-xl: var(--card-radius, 14px);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-body: var(--font-ui, "DM Sans", "Segoe UI", system-ui, sans-serif);
}

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

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background: var(--surface);
    overflow-x: hidden;
    line-height: 1.55;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.auth-page {
    position: relative;
}

.auth-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.orb {
    position: absolute;
    border-radius: 999px;
    opacity: 0.55;
    filter: blur(2px);
}

.orb-one {
    top: 9%;
    left: 6%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(15, 138, 100, 0.2) 0%, rgba(15, 138, 100, 0) 72%);
}

.orb-two {
    top: 18%;
    right: 10%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(44, 142, 165, 0.18) 0%, rgba(44, 142, 165, 0) 70%);
}

.orb-three {
    bottom: 14%;
    left: 42%;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(217, 152, 57, 0.18) 0%, rgba(217, 152, 57, 0) 70%);
}

.orb-four {
    bottom: 10%;
    right: 6%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(15, 138, 100, 0.15) 0%, rgba(15, 138, 100, 0) 72%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 32px));
    min-height: calc(100vh - 32px);
    margin: 16px auto;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: stretch;
}

.auth-story,
.auth-panel {
    position: relative;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow, var(--shadow-md));
    overflow: hidden;
}

.auth-story {
    padding: 34px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background:
        linear-gradient(145deg, rgba(9, 82, 67, 0.97), rgba(19, 115, 90, 0.88)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    color: #f4fbf8;
}

.auth-story::before,
.auth-story::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    opacity: 0.16;
    pointer-events: none;
}

.auth-story::before {
    top: -90px;
    right: -60px;
    width: 260px;
    height: 260px;
    background: #f3be68;
}

.auth-story::after {
    bottom: -80px;
    left: -80px;
    width: 220px;
    height: 220px;
    background: #78d4b0;
}

.brand-mark {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-mark img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    padding: 6px;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(244, 251, 248, 0.72);
}

.brand-copy strong {
    font-size: 1rem;
    font-weight: 700;
}

.story-tag {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff8e8;
    font-size: 0.88rem;
    font-weight: 700;
}

.story-tag::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f3be68;
}

.story-copy-wrap,
.story-grid,
.story-preview,
.panel-head,
.status-stack,
.auth-form,
.panel-bottom {
    position: relative;
    z-index: 1;
}

.story-title {
    max-width: 11ch;
    font-size: clamp(2.5rem, 4vw, 4.3rem);
    line-height: 0.94;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.story-copy {
    max-width: 54ch;
    margin-top: 14px;
    font-size: 1.05rem;
    line-height: 1.72;
    color: rgba(244, 251, 248, 0.82);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.auth-page-register .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-card {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    gap: 10px;
}

.story-card strong {
    font-size: 1.3rem;
    font-weight: 700;
}

.story-card span {
    font-size: 0.94rem;
    line-height: 1.55;
    color: rgba(244, 251, 248, 0.78);
}

.story-preview {
    margin-top: auto;
    border-radius: 28px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.preview-header strong {
    font-size: 1rem;
    font-weight: 700;
}

.preview-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.preview-visual {
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
        rgba(10, 58, 50, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px;
    overflow: hidden;
}

.preview-visual img {
    width: 100%;
    max-height: 240px;
    display: block;
    object-fit: contain;
}

.preview-note {
    margin-top: 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(244, 251, 248, 0.78);
}

.auth-panel {
    padding: var(--card-padding, 24px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg, var(--panel));
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.panel-head h2 {
    font-family: var(--font-heading, var(--font-body));
    font-size: var(--heading-2-size, 22px);
    line-height: 1.2;
    letter-spacing: 0;
    font-weight: var(--heading-weight, 700);
    color: var(--heading-color, var(--text));
}

.panel-head p {
    max-width: 40ch;
    margin-top: 8px;
    color: var(--text-soft);
    font-size: var(--text-sm, 13px);
    line-height: 1.55;
}

.panel-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--btn-border-radius, var(--radius-sm));
    border: 1px solid var(--border-light, rgba(13, 51, 32, 0.12));
    background: var(--green-50, rgba(45, 160, 90, 0.08));
    color: var(--link-color, var(--accent-strong));
    text-decoration: none;
    font-size: var(--text-sm, 13px);
    font-weight: 600;
    transition: transform 160ms ease, background-color 160ms ease;
}

.panel-link:hover {
    transform: translateY(-1px);
    background: var(--green-100, rgba(45, 160, 90, 0.14));
    color: var(--link-hover-color, var(--accent-strong));
}

.status-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: var(--text-sm, 13px);
    line-height: 1.55;
}

.notice::before {
    content: "";
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
}

.notice-error,
.notice-warning {
    background: var(--danger-soft);
    border-color: rgba(177, 77, 68, 0.2);
    color: #7f302a;
}

.notice-error::before,
.notice-warning::before {
    background: var(--danger);
}

.notice-success,
.notice-info {
    background: var(--success-soft);
    border-color: rgba(40, 125, 94, 0.18);
    color: var(--success);
}

.notice-success::before,
.notice-info::before {
    background: var(--success);
}

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

.segment-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--green-50, rgba(45, 160, 90, 0.08));
}

.segment-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-xs, 6px);
    text-decoration: none;
    font-size: var(--text-sm, 13px);
    font-weight: 600;
    color: var(--text-soft);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.segment-link:hover {
    transform: translateY(-1px);
    color: var(--text);
}

.segment-link.is-active {
    background: var(--btn-bg, var(--accent-strong));
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.form-section {
    display: grid;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid rgba(19, 78, 67, 0.1);
}

.form-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

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

.form-field {
    display: grid;
    gap: 8px;
}

.full-span {
    grid-column: 1 / -1;
}

.form-field label {
    font-size: var(--label-font-size, 13px);
    letter-spacing: 0.01em;
    text-transform: none;
    font-weight: var(--label-weight, 600);
    color: var(--label-color, var(--text-muted));
}

.field-shell {
    display: flex;
    align-items: center;
    min-height: 42px;
    border-radius: var(--input-radius, var(--radius-sm));
    border: 1px solid var(--input-border, rgba(13, 51, 32, 0.12));
    background: var(--input-bg, #ffffff);
    box-shadow: none;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        background-color 180ms ease;
}

.field-shell:focus-within {
    transform: none;
    border-color: var(--input-border-focus, var(--green-500));
    box-shadow: var(--input-shadow-focus, 0 0 0 3px rgba(45, 160, 90, 0.18));
    background: #ffffff;
}

.field-shell input,
.field-shell select {
    width: 100%;
    min-height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    padding: var(--input-padding, 10px 14px);
    font-size: var(--input-font-size, var(--text-base, 14px));
}

.field-shell input::placeholder {
    color: var(--input-placeholder, var(--slate-300));
}

.field-shell select {
    appearance: none;
    cursor: pointer;
    padding-right: 48px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
        linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 18px,
        calc(100% - 14px) 18px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.field-shell.is-error {
    border-color: rgba(177, 77, 68, 0.45);
    box-shadow: 0 0 0 4px rgba(177, 77, 68, 0.08), 0 16px 30px rgba(12, 48, 42, 0.05);
}

.field-shell.is-success {
    border-color: rgba(40, 125, 94, 0.38);
}

.field-hint {
    min-height: 1.2rem;
    font-size: var(--text-xs, 11px);
    color: var(--text-muted);
    line-height: 1.4;
}

.field-hint.is-error {
    color: var(--danger);
}

.field-hint.is-success {
    color: var(--success);
}

.password-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border: 0;
    border-radius: var(--radius-xs, 6px);
    background: var(--green-50, rgba(45, 160, 90, 0.08));
    color: var(--accent-strong);
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease;
}

.password-toggle:hover {
    transform: scale(1.04);
    background: rgba(15, 138, 100, 0.14);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.form-meta,
.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.form-footer {
    font-size: 0.95rem;
    color: var(--text-soft);
}

.form-footer a,
.text-link {
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 700;
}

.form-footer a:hover,
.text-link:hover {
    text-decoration: underline;
}

.check-line {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text-soft);
    line-height: 1.5;
}

.check-line input,
.agreement-box input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.primary-btn,
.secondary-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 42px;
    width: 100%;
    border-radius: var(--btn-border-radius, var(--radius-sm));
    cursor: pointer;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.primary-btn {
    border: 0;
    color: #ffffff;
    background: var(--btn-bg, var(--accent-strong));
    box-shadow: var(--shadow-sm);
    font-size: var(--text-base, 14px);
    font-weight: 600;
}

.primary-btn:hover,
.secondary-btn:hover {
    transform: translateY(-1px);
}

.primary-btn:hover {
    background: var(--btn-bg-hover, var(--green-800));
}

.primary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.78;
}

.secondary-btn {
    border: 1px solid var(--border-light, rgba(13, 51, 32, 0.12));
    background: var(--surface-raised, #ffffff);
    color: var(--link-color, var(--accent-strong));
    font-size: var(--text-base, 14px);
    font-weight: 600;
}

.secondary-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.btn-spinner {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    opacity: 0;
    animation: spin 0.75s linear infinite;
}

.submit-btn.is-loading .btn-label {
    opacity: 0;
}

.submit-btn.is-loading .btn-spinner {
    opacity: 1;
}

.divider-line {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.divider-line::before,
.divider-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(19, 78, 67, 0.12);
}

.password-rules {
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--green-50, rgba(45, 160, 90, 0.08));
    border: 1px solid var(--border-light, rgba(13, 51, 32, 0.12));
}

.password-rules strong {
    display: block;
    margin-bottom: 10px;
    font-size: var(--text-sm, 13px);
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.rule-list {
    display: grid;
    gap: 8px;
    list-style: none;
    color: var(--text-soft);
    font-size: var(--text-sm, 13px);
    line-height: 1.5;
}

.rule-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rule-list li::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.agreement-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--green-50, rgba(45, 160, 90, 0.08));
    border: 1px solid var(--border-light, rgba(13, 51, 32, 0.12));
    color: var(--text-soft);
    line-height: 1.6;
}

.agreement-box label {
    cursor: pointer;
}

.panel-bottom {
    margin-top: 26px;
}

.support-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(15, 138, 100, 0.05);
    border: 1px solid rgba(15, 138, 100, 0.1);
}

.support-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.94rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.support-card p {
    color: var(--text-soft);
    line-height: 1.55;
}

.support-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.support-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 138, 100, 0.12);
    text-decoration: none;
    font-weight: 700;
    color: var(--accent-strong);
}

body.modal-open {
    overflow: hidden;
}

.auth-modal-overlay[hidden] {
    display: none !important;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(var(--footer-h) + 28px);
    overflow-y: auto;
    background: rgba(8, 26, 24, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-modal-overlay.is-open {
    display: flex;
}

.auth-modal-card {
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(18, 73, 61, 0.12);
    box-shadow: 0 30px 80px rgba(12, 48, 42, 0.22);
}

.agreement-modal-card {
    position: relative;
    width: min(460px, 100%);
    margin: auto;
    max-height: none;
    padding: 34px 30px 28px;
    border-radius: 30px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 249, 0.98));
    box-shadow: 0 34px 90px rgba(12, 48, 42, 0.26);
}

.auth-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.auth-modal-head h3 {
    margin-top: 8px;
    font-size: 1.55rem;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.auth-modal-head p {
    margin-top: 10px;
    color: var(--text-soft);
    line-height: 1.6;
}

.auth-modal-body {
    margin-top: 20px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(15, 138, 100, 0.05);
    border: 1px solid rgba(15, 138, 100, 0.1);
}

.auth-modal-body p {
    color: var(--text-soft);
    line-height: 1.7;
}

.auth-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-modal-actions .primary-btn,
.auth-modal-actions .secondary-btn {
    flex: 1 1 220px;
    width: auto;
}

.agreement-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
}

.agreement-modal-top {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.agreement-modal-caption {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 138, 100, 0.08);
    border: 1px solid rgba(15, 138, 100, 0.12);
    color: var(--accent-strong);
    font-weight: 700;
}

.agreement-modal-top h3 {
    max-width: 14ch;
    font-size: clamp(1.7rem, 3vw, 2rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.agreement-modal-top p {
    max-width: 34ch;
    color: var(--text-soft);
    line-height: 1.65;
}

.agreement-modal-body {
    margin-top: 22px;
}

.agreement-modal-body p {
    max-width: 34ch;
    margin: 0 auto;
}

.agreement-modal-actions {
    justify-content: center;
    margin-top: 22px;
}

.agreement-modal-actions .primary-btn,
.agreement-modal-actions .secondary-btn {
    min-width: 200px;
}

.ndi-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 26, 24, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ndi-modal-overlay.is-open {
    display: flex;
}

.ndi-modal-card {
    width: min(540px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 28px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(18, 73, 61, 0.12);
    box-shadow: 0 30px 80px rgba(12, 48, 42, 0.24);
}

.ndi-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.ndi-modal-head h3 {
    font-size: 1.7rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.ndi-modal-head p {
    margin-top: 10px;
    color: var(--text-soft);
    line-height: 1.6;
}

.modal-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(15, 138, 100, 0.08);
    color: var(--accent-strong);
    cursor: pointer;
    flex-shrink: 0;
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.ndi-modal-body {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.mobile-ndi-btn {
    text-decoration: none;
}

.qr-shell {
    display: grid;
    place-items: center;
    min-height: 252px;
    padding: 20px;
    border-radius: 24px;
    background:
        linear-gradient(160deg, rgba(15, 138, 100, 0.08), rgba(255, 255, 255, 0.92)),
        #ffffff;
    border: 1px solid rgba(15, 138, 100, 0.12);
}

.qr-wrapper {
    position: relative;
    width: 212px;
    height: 212px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: #ffffff;
    border: 2px solid rgba(15, 138, 100, 0.14);
    box-shadow: 0 12px 28px rgba(12, 48, 42, 0.08);
}

.loading-state,
.error-state {
    display: grid;
    place-items: center;
    gap: 12px;
    text-align: center;
    color: var(--text-soft);
    line-height: 1.55;
}

.spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(15, 138, 100, 0.14);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-logo-overlay {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    padding: 4px;
    box-shadow: 0 8px 18px rgba(12, 48, 42, 0.14);
}

.instruction-list {
    display: grid;
    gap: 12px;
    list-style: none;
}

.instruction-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-soft);
    line-height: 1.55;
}

.instruction-list li::before {
    content: counter(list-item);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 138, 100, 0.12);
    color: var(--accent-strong);
    font-weight: 700;
    flex-shrink: 0;
}

.inline-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.download-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(15, 138, 100, 0.05);
    border: 1px solid rgba(15, 138, 100, 0.1);
}

.download-card p {
    color: var(--text-soft);
    line-height: 1.55;
}

.store-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.store-buttons > * {
    flex: 1 1 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(15, 138, 100, 0.12);
}

.store-buttons img {
    max-width: 140px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.mini-caption {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

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

@media (max-width: 1080px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .story-title {
        max-width: none;
    }

    .preview-visual img {
        max-height: 190px;
    }
}

@media (max-width: 720px) {
    .auth-shell {
        width: min(100%, calc(100% - 18px));
        margin: 9px auto;
        gap: 14px;
    }

    .auth-story,
    .auth-panel,
    .ndi-modal-card {
        border-radius: 24px;
    }

    .auth-story,
    .auth-panel,
    .ndi-modal-card {
        padding: 22px;
    }

    .story-grid,
    .auth-page-register .story-grid,
    .form-grid,
    .segment-control {
        grid-template-columns: 1fr;
    }

    .panel-head,
    .support-card,
    .form-meta,
    .form-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .support-links,
    .store-buttons {
        width: 100%;
    }

    .story-title {
        font-size: clamp(2.15rem, 9vw, 3rem);
    }
}

@media (max-width: 460px) {
    .brand-mark {
        width: 100%;
        justify-content: flex-start;
        border-radius: 22px;
    }

    .primary-btn,
    .secondary-btn,
    .panel-link,
    .segment-link {
        width: 100%;
    }

    .auth-modal-overlay {
        padding: 12px;
    }

    .auth-modal-card {
        padding: 22px;
        border-radius: 22px;
    }

    .agreement-modal-card {
        width: min(100%, 420px);
        padding: 26px 18px 20px;
    }

    .agreement-modal-close {
        top: 12px;
        right: 12px;
    }

    .agreement-modal-top h3,
    .agreement-modal-top p,
    .agreement-modal-body p {
        max-width: none;
    }

    .auth-modal-actions {
        display: grid;
    }

    .auth-modal-actions .primary-btn,
    .auth-modal-actions .secondary-btn {
        width: 100%;
    }

    .ndi-modal-overlay {
        padding: 10px;
    }

    .qr-wrapper {
        width: 190px;
        height: 190px;
    }
}

/* Centered Auth Layout Overrides */
.auth-top-banners {
    position: relative;
    z-index: 1;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: grid;
    gap: 0;
    margin: 0 0 8px;
}

.auth-banner {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-banner .header-banner{
    object-fit: contain;
    height: 100%;
    width: auto;
}

.auth-banner-primary {
    width: min(1180px, calc(100vw - 28px));
    margin: 0 auto;
    height: clamp(92px, 13vw, 150px);
}

.auth-banner-secondary {
    height: clamp(90px, 15vw, 170px);
    box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.2);
}

.auth-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100% - 20px));
    min-height: auto;
    margin: 10px auto 8px;
    display: block;
}

.auth-panel-centered {
    padding: var(--card-padding);
    gap: 14px;
    border-radius: var(--card-radius);
}

.logo-stage {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    margin-bottom: 18px;
}

.logo-stage-cc {
    width: min(320px, 100%);
    max-height: 118px;
    object-fit: contain;
    filter: drop-shadow(0 14px 30px rgba(12, 48, 42, 0.1));
}

.logo-stage-bpc {
    width: 84px;
    height: 84px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.panel-head-centered {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin-bottom: 14px;
}

.panel-head-centered p {
    max-width: 48ch;
    margin-top: 6px;
    line-height: 1.55;
}

.panel-head-centered .panel-link {
    margin-top: 4px;
}

.segment-control {
    gap: 6px;
    padding: 6px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
}

.segment-link {
    min-height: 42px;
    border-radius: var(--radius-xs);
}

.panel-link {
    min-height: 42px;
    padding: 0 14px;
    border-radius: var(--btn-border-radius);
}

.auth-form {
    gap: 12px;
}

.form-grid {
    gap: 10px;
}

.form-field {
    gap: 5px;
}

.form-field label {
    font-size: var(--label-font-size);
    letter-spacing: 0.01em;
}

.status-stack {
    gap: 8px;
    margin-bottom: 12px;
}

.notice {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.field-shell {
    min-height: 42px;
    border-radius: var(--input-radius);
    box-shadow: none;
}

.field-shell input,
.field-shell select {
    min-height: 42px;
    padding: var(--input-padding);
    font-size: var(--input-font-size);
}

.field-shell select {
    padding-right: 42px;
    background-position:
        calc(100% - 20px) 20px,
        calc(100% - 14px) 20px;
}

.field-hint {
    min-height: 1rem;
    font-size: var(--text-xs);
}

.password-toggle {
    width: 34px;
    height: 34px;
    margin-right: 8px;
    border-radius: var(--radius-xs);
}

.form-meta,
.form-footer {
    gap: 10px;
}

.check-line {
    gap: 8px;
}

.primary-btn,
.secondary-btn {
    min-height: 42px;
    border-radius: var(--btn-border-radius);
}

.divider-line {
    gap: 12px;
    font-size: 0.74rem;
}

.password-rules,
.agreement-box,
.support-card {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

.rule-list {
    gap: 6px;
    font-size: var(--text-sm);
}

.auth-footer {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 10px 0 0;
    padding: 16px 12px 18px;
    display: grid;
    gap: 6px;
    text-align: center;
    color: #ffffff;
    font-size: var(--text-sm);
    line-height: 1.6;
    background: var(--green-700);
}

.auth-footer p {
    max-width: 920px;
    margin: 0 auto;
}

.auth-footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-footer span {
    display: inline-block;
    padding: 0 6px;
    color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 720px) {
    .auth-top-banners {
        margin-bottom: 6px;
    }

    .auth-banner-primary {
        width: calc(100vw - 16px);
        height: clamp(72px, 20vw, 108px);
    }

    .auth-banner-secondary {
        height: clamp(72px, 22vw, 116px);
    }

    .auth-shell {
        width: min(100%, calc(100% - 14px));
        margin: 6px auto 8px;
    }

    .auth-panel-centered {
        padding: 14px 12px 16px;
    }

    .logo-stage-cc {
        width: min(240px, 100%);
        max-height: 90px;
    }

    .logo-stage-bpc {
        width: 72px;
        height: 72px;
        padding: 12px;
        border-radius: var(--radius-sm);
    }

    .panel-head-centered {
        gap: 12px;
    }

    .panel-head-centered .panel-link {
        width: 100%;
    }

    .auth-footer {
        margin-top: 8px;
        padding: 14px 10px 16px;
    }
}

@media (max-width: 520px) {
    .auth-panel-centered {
        border-radius: var(--card-radius);
    }

    .segment-control {
        grid-template-columns: 1fr;
    }

    .form-meta,
    .form-footer {
        justify-content: center;
        text-align: center;
    }

    .check-line {
        justify-content: center;
        width: 100%;
    }
}

/* Auth pages aligned to the shared app theme used by the Others app. */
body.auth-page {
    background: var(--surface);
    color: var(--text-color);
    font-family: var(--font-ui);
}

.auth-top-banners {
    width: min(1120px, calc(100% - 32px));
    margin: 18px auto 0;
}

.auth-banner-primary {
    width: 100%;
    height: 58px;
    justify-content: flex-start;
}

.auth-banner-primary img {
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

.auth-banner-secondary {
    display: none;
}

.auth-shell,
.auth-shell-login,
.auth-shell-password {
    width: min(640px, calc(100% - 32px));
    margin: 18px auto 24px;
}

.auth-shell-register,
.auth-shell-org-register {
    width: min(920px, calc(100% - 32px));
}

.auth-panel,
.auth-panel-centered,
.password-panel {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    padding: 22px;
}

.panel-head,
.panel-head-centered {
    align-items: flex-start;
    text-align: left;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-light);
}

.panel-head-centered {
    flex-direction: row;
    justify-content: space-between;
}

.panel-head h2 {
    margin: 0;
    color: var(--heading-color);
    font-family: var(--font-heading);
    font-size: var(--heading-2-size);
    font-weight: var(--heading-weight);
    line-height: 1.2;
}

.panel-head p {
    max-width: 58ch;
    margin-top: 6px;
    color: var(--muted-color);
    font-size: var(--text-sm);
    line-height: 1.55;
}

.mini-caption {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    min-height: 28px;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: var(--badge-radius);
    background: var(--green-100);
    color: var(--green-800);
    border: 1px solid var(--green-300);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.panel-link {
    min-height: 36px;
    border-radius: var(--radius-xs);
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    color: var(--link-color);
    font-size: var(--text-sm);
    font-weight: 600;
}

.panel-link:hover {
    background: var(--green-50);
    color: var(--link-hover-color);
    box-shadow: var(--shadow-xs);
}

.segment-control {
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--slate-50);
}

.segment-link {
    min-height: 38px;
    border-radius: var(--radius-xs);
    color: var(--slate-700);
    font-size: var(--text-sm);
    font-weight: 600;
}

.segment-link.is-active {
    background: var(--green-700);
    color: var(--white);
    box-shadow: var(--shadow-xs);
}

.auth-form {
    gap: 14px;
}

.form-section {
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.form-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.form-grid {
    gap: 14px 16px;
}

.form-field {
    gap: 4px;
}

.form-field label {
    color: var(--label-color);
    font-size: var(--label-font-size);
    font-weight: var(--label-weight);
    letter-spacing: 0.01em;
    text-transform: none;
}

.field-shell {
    min-height: 40px;
    border-radius: var(--input-radius);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    box-shadow: none;
}

.field-shell:focus-within {
    border-color: var(--input-border-focus);
    box-shadow: var(--input-shadow-focus);
}

.field-shell input,
.field-shell select {
    min-height: 40px;
    padding: var(--input-padding);
    color: var(--input-color);
    font-family: var(--font-ui);
    font-size: var(--input-font-size);
}

.field-shell input::placeholder {
    color: var(--input-placeholder);
}

.field-shell select {
    background-position:
        calc(100% - 20px) 17px,
        calc(100% - 14px) 17px;
}

.field-hint {
    color: var(--muted-color);
    font-size: var(--text-xs);
}

.primary-btn,
.secondary-btn {
    min-height: 42px;
    border-radius: var(--btn-border-radius);
    font-size: var(--text-base);
    font-weight: 600;
}

.primary-btn {
    background: var(--btn-bg);
    box-shadow: none;
}

.primary-btn:hover {
    background: var(--btn-bg-hover);
    box-shadow: var(--shadow-sm);
}

.secondary-btn {
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    color: var(--link-color);
}

.password-rules,
.agreement-box,
.password-summary-card,
.password-empty-state,
.password-choice-card {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--slate-50);
}

.password-rules strong {
    color: var(--green-700);
    font-size: var(--text-sm);
    letter-spacing: 0.04em;
}

.rule-list,
.agreement-box,
.form-footer,
.check-line {
    color: var(--slate-700);
    font-size: var(--text-sm);
}

.notice {
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
}

.logo-stage-bpc {
    width: 64px;
    height: 64px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-xs);
}

.auth-footer {
    background: var(--green-700);
    color: var(--white);
    font-size: var(--text-sm);
}

@media (max-width: 720px) {
    .auth-top-banners,
    .auth-shell,
    .auth-shell-login,
    .auth-shell-password,
    .auth-shell-register,
    .auth-shell-org-register {
        width: min(100%, calc(100% - 20px));
    }

    .auth-panel,
    .auth-panel-centered,
    .password-panel {
        padding: 18px;
    }

    .panel-head-centered {
        flex-direction: column;
    }
}

/* Final theme fit: auth pages use the same page/card rhythm as the Others app. */
.auth-public-page.main {
    max-width: 1120px;
    min-height: auto;
    padding: 0 1rem;
    background: var(--surface);
}

.auth-public-page.auth-shell {
    display: block;
}

.auth-card.auth-panel,
.auth-card.auth-panel-centered,
.auth-card.password-panel {
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.auth-card > .card-body {
    padding: 22px;
}

.auth-card .panel-head {
    margin-bottom: 18px;
}

.auth-card .panel-link,
.auth-card .primary-btn,
.auth-card .secondary-btn,
.auth-card .segment-link,
.auth-card .password-toggle {
    border-radius: var(--radius-xs);
}

.auth-card .primary-btn {
    background: var(--btn-bg);
    color: var(--btn-text);
}

.auth-card .primary-btn:hover {
    background: var(--btn-bg-hover);
}

.auth-card .secondary-btn {
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    color: var(--link-color);
}

.auth-card .secondary-btn:hover {
    background: var(--green-50);
    color: var(--link-hover-color);
}

.auth-card .field-shell {
    border-radius: var(--input-radius);
}

.auth-card .password-rules,
.auth-card .agreement-box,
.auth-card .password-summary-card,
.auth-card .password-empty-state,
.auth-card .password-choice-card {
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .auth-card > .card-body {
        padding: 18px;
    }
}

/* Restore the original public auth banner treatment. */
.auth-top-banners {
    position: relative;
    z-index: 1;
    width: 100vw;
    margin: 0 0 8px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: grid;
    gap: 0;
}

.auth-banner {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-banner-primary {
    width: min(1180px, calc(100vw - 28px));
    height: clamp(92px, 13vw, 150px);
    margin: 0 auto;
    justify-content: center;
}

.auth-banner-primary img,
.auth-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.auth-banner .header-banner {
    width: auto;
    height: 100%;
    object-fit: contain;
}

.auth-banner-secondary {
    display: flex;
    height: clamp(90px, 15vw, 170px);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 720px) {
    .auth-top-banners {
        width: 100vw;
        margin-bottom: 6px;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
    }

    .auth-banner-primary {
        width: calc(100vw - 16px);
        height: clamp(72px, 20vw, 108px);
    }

    .auth-banner-secondary {
        display: flex;
        height: clamp(72px, 22vw, 116px);
    }
}

/* Restore the design-system auth footer from base.css. */
.auth-footer.auth-footer-login {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 900;
    width: 100%;
    min-height: var(--footer-h);
    margin: 0;
    padding: 12px 16px;
    display: grid;
    gap: 4px;
    text-align: center;
    color: var(--white);
    font-size: 0.89rem;
    font-weight: 400;
    line-height: 1.5;
    background: linear-gradient(90deg, #0d7c5b 0%, #124143 55%, #d99839 100%);
    box-shadow: 0 -3px 13px rgba(0, 0, 0, 0.14);
}

.auth-footer.auth-footer-login p {
    max-width: 920px;
    margin: 0 auto;
}

.auth-footer.auth-footer-login span {
    display: inline-block;
    padding: 0 6px;
    color: rgba(255, 255, 255, 0.72);
}

body.auth-page {
    padding-bottom: calc(var(--footer-h) + 36px);
}

.auth-public-page.auth-shell {
    margin-bottom: 40px;
}

@media (max-width: 720px) {
    body.auth-page {
        padding-bottom: calc(var(--footer-h) + 28px);
    }

    .auth-public-page.auth-shell {
        margin-bottom: 28px;
    }
}

