.aff-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.aff-landing code {
    font-size: 0.9em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.aff-link-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.aff-link-row .form-input {
    flex: 1;
}

.aff-negative {
    color: #b91c1c;
}

.aff-status {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.aff-status--pending { color: var(--primary-600, #4f46e5); }
.aff-status--approved { color: #15803d; }
.aff-status--rejected,
.aff-status--disabled { color: #b91c1c; }

.auth-form textarea.form-input,
.aff-dash textarea.form-input {
    min-height: 6rem;
    width: 100%;
    padding: 0.75rem 1rem;
    line-height: 1.5;
}

@media (max-width: 720px) {
    .aff-link-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* === Audit Fix: Affiliate Portal (.ud-*) Design System === */
.ud-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
}

.ud-sidebar {
    position: sticky;
    top: 5.5rem;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ud-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ud-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.65rem;
    color: var(--text-secondary, #475569);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ud-nav a:hover {
    background: var(--surface-container-low, #f2f3ff);
    color: var(--primary-500, #5b4bff);
}

.ud-nav a.active,
.ud-nav a.is-active {
    background: var(--primary-500, #5b4bff);
    color: #ffffff;
}

.ud-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ud-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.ud-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.ud-stat {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 0.9rem;
    padding: 1.15rem;
}

.ud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ud-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--surface-container-low, #f2f3ff);
    color: var(--text-tertiary, #64748b);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
}

.ud-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
    color: var(--text-primary, #0f172a);
}

.ud-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 0.65rem;
    background: var(--primary-500, #5b4bff);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.ud-btn:hover { background: var(--primary-600, #4129e7); color: #ffffff; }

.ud-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary-50, #f2f0ff);
    color: var(--primary-600, #4129e7);
}

@media (max-width: 980px) {
    .ud-wrap { grid-template-columns: 1fr; }
    .ud-sidebar { position: static; }
    .ud-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .ud-stats { grid-template-columns: 1fr; }
}


/* === SafloLabs Affiliate Landing Page (Stitch UI Design, Light + Dark RGB Tokens) === */
.aff-landing {
    --aff-primary: rgb(91, 75, 255);
    --aff-primary-hover: rgb(65, 41, 231);
    --aff-primary-deep: rgb(52, 14, 221);
    --aff-primary-tint: rgb(242, 240, 255);
    --aff-primary-tint-strong: rgb(227, 223, 255);

    --aff-amber: rgb(255, 176, 32);
    --aff-gold: rgb(253, 175, 30);
    --aff-amber-text: rgb(180, 83, 9);
    --aff-amber-tint: rgb(255, 251, 235);

    --aff-emerald: rgb(22, 163, 74);
    --aff-emerald-deep: rgb(0, 123, 52);
    --aff-emerald-tint: rgb(240, 253, 244);

    --aff-canvas: rgb(250, 248, 255);
    --aff-alt: rgb(242, 243, 255);
    --aff-card: rgb(255, 255, 255);
    --aff-card-hover: rgb(255, 255, 255);
    --aff-glass: rgba(255, 255, 255, 0.86);

    --aff-ink: rgb(15, 23, 42);
    --aff-ink-secondary: rgb(71, 85, 105);
    --aff-ink-muted: rgb(100, 116, 139);
    --aff-border: rgb(226, 232, 240);
    --aff-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(91, 75, 255, 0.04);
    --aff-shadow-hover: 0 18px 35px -8px rgba(15, 23, 42, 0.10), 0 6px 14px -4px rgba(91, 75, 255, 0.08);

    background: var(--aff-canvas);
    color: var(--aff-ink);
    font-family: var(--font-primary, 'Poppins', Arial, sans-serif);
    transition: background-color 0.25s ease, color 0.25s ease;
}

[data-theme="dark"] .aff-landing {
    --aff-canvas: rgb(11, 15, 25);
    --aff-alt: rgb(16, 23, 38);
    --aff-card: rgb(19, 27, 46);
    --aff-card-hover: rgb(28, 38, 61);
    --aff-glass: rgba(19, 27, 46, 0.88);

    --aff-ink: rgb(248, 250, 252);
    --aff-ink-secondary: rgb(203, 213, 225);
    --aff-ink-muted: rgb(148, 163, 184);
    --aff-border: rgb(40, 48, 68);
    --aff-primary-tint: rgba(91, 75, 255, 0.16);
    --aff-primary-tint-strong: rgba(91, 75, 255, 0.25);
    --aff-amber-tint: rgba(255, 176, 32, 0.14);
    --aff-amber-text: rgb(253, 175, 30);
    --aff-emerald-tint: rgba(22, 163, 74, 0.16);
    --aff-emerald-deep: rgb(98, 223, 125);
    --aff-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.45), 0 4px 12px -2px rgba(91, 75, 255, 0.10);
    --aff-shadow-hover: 0 20px 40px -8px rgba(0, 0, 0, 0.60), 0 8px 16px -4px rgba(91, 75, 255, 0.18);
}

.aff-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.aff-section {
    padding: 4.5rem 0;
}

.aff-section--alt {
    background: var(--aff-alt);
    transition: background-color 0.25s ease;
}

.aff-mono {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-variant-numeric: tabular-nums;
}

.aff-hero {
    position: relative;
    overflow: hidden;
    padding: 4.75rem 0 4.5rem;
}

.aff-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(72px);
    pointer-events: none;
}

.aff-orb--indigo {
    width: 24rem;
    height: 24rem;
    top: -6rem;
    left: -6rem;
    opacity: 0.24;
    background: radial-gradient(circle, rgb(91, 75, 255) 0%, transparent 70%);
}

.aff-orb--amber {
    width: 24rem;
    height: 24rem;
    top: 25%;
    right: -6rem;
    opacity: 0.18;
    background: radial-gradient(circle, rgb(255, 176, 32) 0%, transparent 70%);
}

.aff-orb--emerald {
    width: 20rem;
    height: 20rem;
    bottom: -6rem;
    left: 34%;
    opacity: 0.14;
    background: radial-gradient(circle, rgb(22, 163, 74) 0%, transparent 70%);
}

.aff-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2.75rem;
    align-items: center;
}

.aff-hero-copy {
    grid-column: span 6 / span 6;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.aff-hero-preview {
    grid-column: span 6 / span 6;
}

.aff-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.42rem 0.9rem;
    border-radius: 9999px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
}

.aff-pill--indigo {
    background: var(--aff-primary-tint);
    color: var(--aff-primary);
}

[data-theme="dark"] .aff-pill--indigo {
    color: rgb(196, 192, 255);
}

.aff-pill--amber {
    background: var(--aff-amber-tint);
    color: var(--aff-amber-text);
}

.aff-pill--emerald {
    background: var(--aff-emerald-tint);
    color: var(--aff-emerald-deep);
}

.aff-pill-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: currentColor;
}

.aff-hero-title {
    margin: 0;
    font-size: clamp(2.25rem, 4.2vw, 3.35rem);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.025em;
    color: var(--aff-ink);
}

.aff-hero-lede {
    margin: 0;
    max-width: 34rem;
    font-size: 1.08rem;
    line-height: 1.65;
    color: var(--aff-ink-secondary);
}

.aff-landing .aff-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 0.25rem;
}

.aff-btn-primary,
.aff-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.aff-btn-primary {
    border: 1px solid transparent;
    background: var(--aff-primary);
    color: #ffffff;
}

.aff-btn-primary:hover {
    background: var(--aff-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -4px rgba(91, 75, 255, 0.40);
}

.aff-btn-secondary {
    border: 1px solid var(--aff-border);
    background: transparent;
    color: var(--aff-ink);
}

.aff-btn-secondary:hover {
    border-color: var(--aff-primary);
    background: var(--aff-primary-tint);
    color: var(--aff-ink);
    transform: translateY(-1px);
}

.aff-btn-full {
    width: 100%;
}

.aff-trust-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.15rem;
    padding-top: 0.35rem;
    font-size: 0.86rem;
    color: var(--aff-ink-muted);
}

.aff-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.aff-trust-item .is-emerald { color: var(--aff-emerald); }
.aff-trust-item .is-indigo  { color: var(--aff-primary); }
.aff-trust-item .is-amber   { color: var(--aff-amber); }

.aff-glass-card {
    background: var(--aff-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--aff-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--aff-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.aff-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.aff-preview-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--aff-ink);
}

.aff-preview-sub {
    margin: 0.15rem 0 0;
    font-size: 0.84rem;
    color: var(--aff-ink-muted);
}

.aff-ref-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    background: var(--aff-canvas);
    border: 1px solid var(--aff-border);
}

.aff-ref-url-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
}

.aff-ref-url-wrap i {
    color: var(--aff-primary);
    flex-shrink: 0;
}

.aff-ref-url {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--aff-ink);
    background: transparent;
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aff-copy-btn {
    padding: 0.52rem 0.95rem;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.aff-copy-btn.is-copied {
    background: var(--aff-emerald);
}

.aff-tier-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aff-tier-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    background: var(--aff-card);
    border: 1px solid var(--aff-border);
}

.aff-tier-name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--aff-ink);
}

.aff-tier-meta {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: var(--aff-ink-muted);
}

.aff-tier-earn {
    text-align: right;
    flex-shrink: 0;
}

.aff-tier-amount {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--aff-emerald-deep);
}

.aff-tier-label {
    margin: 0.1rem 0 0;
    font-size: 0.76rem;
    color: var(--aff-ink-muted);
}

.aff-preview-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.aff-section-head {
    max-width: 42rem;
    margin: 0 auto 3rem;
    text-align: center;
}

.aff-section-head h2 {
    margin: 0.75rem 0 0.85rem;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--aff-ink);
}

.aff-section-head p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--aff-ink-secondary);
}

.aff-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.aff-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
}

.aff-card {
    background: var(--aff-card);
    border: 1px solid var(--aff-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--aff-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.aff-card--interactive:hover {
    transform: translateY(-2px);
    background: var(--aff-card-hover);
    box-shadow: var(--aff-shadow-hover);
}

.aff-icon-box {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.aff-icon-box--indigo  { background: var(--aff-primary-tint); color: var(--aff-primary); }
.aff-icon-box--amber   { background: var(--aff-amber-tint);   color: var(--aff-amber-text); }
.aff-icon-box--emerald { background: var(--aff-emerald-tint); color: var(--aff-emerald-deep); }

[data-theme="dark"] .aff-icon-box--indigo { color: rgb(196, 192, 255); }

.aff-card-title {
    margin: 0 0 0.45rem;
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--aff-ink);
}

.aff-card-desc {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--aff-ink-secondary);
}

.aff-step-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.15rem;
}

.aff-step-icon {
    color: var(--aff-ink-muted);
    font-size: 1.15rem;
}

.aff-calc-card {
    padding: 2.25rem;
}

.aff-calc-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2.5rem;
    align-items: center;
}

.aff-calc-controls {
    grid-column: span 7 / span 7;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.aff-calc-result-wrap {
    grid-column: span 5 / span 5;
}

.aff-slider-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.aff-slider-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--aff-ink);
}

.aff-slider-val {
    padding: 0.3rem 0.75rem;
    border-radius: 8px;
    background: var(--aff-primary-tint);
    color: var(--aff-primary);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

[data-theme="dark"] .aff-slider-val {
    color: rgb(196, 192, 255);
}

input[type="range"].aff-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 9999px;
    background: var(--aff-border);
    outline: none;
    cursor: pointer;
}

input[type="range"].aff-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background: var(--aff-primary);
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(91, 75, 255, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease;
}

input[type="range"].aff-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"].aff-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background: var(--aff-primary);
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(91, 75, 255, 0.45);
    cursor: pointer;
}

.aff-slider-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--aff-ink-muted);
}

.aff-calc-note {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    color: var(--aff-ink-muted);
}

.aff-calc-note i {
    color: var(--aff-primary);
}

.aff-calc-output {
    background: var(--aff-canvas);
    border: 1px solid var(--aff-border);
    border-radius: 14px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.aff-calc-out-label {
    margin: 0 0 0.25rem;
    font-size: 0.84rem;
    color: var(--aff-ink-muted);
}

.aff-calc-monthly {
    margin: 0;
    font-size: 2.15rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--aff-emerald-deep);
}

.aff-calc-annual-block {
    padding-top: 1.15rem;
    border-top: 1px solid var(--aff-border);
}

.aff-calc-annual {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--aff-ink);
}

.aff-policy-card {
    padding: 1.85rem;
    display: flex;
    flex-direction: column;
}

.aff-policy-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.35rem;
}

.aff-policy-head .aff-icon-box {
    margin-bottom: 0;
}

.aff-policy-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aff-policy-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--aff-ink-secondary);
}

.aff-policy-list li strong {
    color: var(--aff-ink);
}

.aff-policy-list li i {
    margin-top: 0.28rem;
    flex-shrink: 0;
}

.aff-policy-list--emerald li i { color: var(--aff-emerald); }
.aff-policy-list--amber li i   { color: var(--aff-amber-text); }

.aff-policy-foot {
    margin-top: 1.5rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--aff-border);
}

.aff-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--aff-primary);
    text-decoration: none;
}

.aff-text-link:hover {
    text-decoration: underline;
}

[data-theme="dark"] .aff-text-link {
    color: rgb(158, 149, 255);
}

.aff-banner {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 3.5rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgb(91, 75, 255) 0%, rgb(65, 41, 231) 55%, rgb(52, 14, 221) 100%);
    box-shadow: 0 20px 40px -12px rgba(91, 75, 255, 0.42);
}

.aff-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 42rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
}

.aff-banner h2 {
    margin: 0;
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.aff-banner p {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgb(237, 233, 255);
}

.aff-banner-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.aff-btn-banner-white,
.aff-btn-banner-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.aff-btn-banner-white {
    background: #ffffff;
    color: rgb(52, 14, 221);
}

.aff-btn-banner-white:hover {
    color: rgb(52, 14, 221);
    transform: translateY(-2px);
}

.aff-btn-banner-ghost {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.aff-btn-banner-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .aff-hero-copy,
    .aff-hero-preview,
    .aff-calc-controls,
    .aff-calc-result-wrap {
        grid-column: span 12 / span 12;
    }

    .aff-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .aff-section {
        padding: 3.25rem 0;
    }

    .aff-hero {
        padding: 3rem 0 3.25rem;
    }

    .aff-grid-4,
    .aff-grid-2 {
        grid-template-columns: 1fr;
    }

    .aff-calc-card {
        padding: 1.5rem;
    }

    .aff-ref-box {
        flex-direction: column;
        align-items: stretch;
    }

    .aff-slider-row-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================================
   STITCH REDESIGN — AFFILIATE AUTHENTICATION (REGISTER & LOGIN)
   Uses exact variables.css RGB tokens across Light and [data-theme="dark"].
   ============================================================================ */

.aff-auth-shell {
    --aff-a-primary: rgb(91, 75, 255);
    --aff-a-primary-hover: rgb(65, 41, 231);
    --aff-a-primary-deep: rgb(52, 14, 221);
    --aff-a-amber: rgb(255, 176, 32);
    --aff-a-emerald: rgb(22, 163, 74);
    --aff-a-emerald-bright: rgb(74, 222, 128);
    --aff-a-danger: rgb(239, 68, 68);
    --aff-a-bg: rgb(250, 248, 255);
    --aff-a-card: rgb(255, 255, 255);
    --aff-a-input: rgb(248, 250, 252);
    --aff-a-border: rgb(226, 232, 240);
    --aff-a-text: rgb(15, 23, 42);
    --aff-a-muted: rgb(71, 85, 105);
    --aff-a-subtle: rgb(100, 116, 139);
    --aff-a-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.03);

    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 70px);
    background-color: var(--aff-a-bg);
    color: var(--aff-a-text);
    font-family: var(--font-sans, 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif);
}

[data-theme="dark"] .aff-auth-shell {
    --aff-a-bg: rgb(11, 15, 25);
    --aff-a-card: rgb(19, 27, 46);
    --aff-a-input: rgb(28, 38, 61);
    --aff-a-border: rgb(40, 48, 68);
    --aff-a-text: rgb(248, 250, 252);
    --aff-a-muted: rgb(148, 163, 184);
    --aff-a-subtle: rgb(148, 163, 184);
    --aff-a-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

@media (min-width: 1024px) {
    .aff-auth-shell {
        grid-template-columns: minmax(420px, 46%) minmax(480px, 54%);
    }
}

/* ---- Left Brand Overview Panel (Always Rich Dark Indigo-Slate Canvas) ---- */
.aff-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.25rem;
    padding: 3rem 2rem;
    background: linear-gradient(160deg, rgb(11, 15, 25) 0%, rgb(19, 27, 46) 55%, rgb(15, 23, 42) 100%);
    color: rgb(248, 250, 252);
    border-bottom: 1px solid rgb(40, 48, 68);
}

@media (min-width: 1024px) {
    .aff-auth-brand {
        padding: 3.75rem 3.25rem;
        border-bottom: 0;
        border-right: 1px solid rgb(40, 48, 68);
    }
}

.aff-auth-brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.aff-auth-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(80px);
    pointer-events: none;
}

.aff-auth-orb-indigo {
    width: 360px;
    height: 360px;
    top: -110px;
    left: -90px;
    background: rgba(91, 75, 255, 0.24);
}

.aff-auth-orb-amber {
    width: 280px;
    height: 280px;
    bottom: -90px;
    right: -70px;
    background: rgba(255, 176, 32, 0.14);
}

.aff-auth-brand-inner {
    position: relative;
    z-index: 2;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.aff-auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    align-self: flex-start;
    padding: 0.42rem 0.9rem;
    border-radius: 9999px;
    background: rgba(91, 75, 255, 0.16);
    border: 1px solid rgba(91, 75, 255, 0.35);
    color: rgb(199, 210, 254);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aff-auth-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 9999px;
    background: rgb(74, 222, 128);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.25);
}

.aff-auth-brand h1 {
    margin: 0;
    font-size: clamp(1.9rem, 3.1vw, 2.55rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: rgb(255, 255, 255);
}

.aff-auth-brand-accent {
    background: linear-gradient(120deg, rgb(129, 140, 248) 0%, rgb(255, 176, 32) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.aff-auth-brand-lead {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgb(148, 163, 184);
}

/* Floating Glass Showcase Card */
.aff-auth-glass-card {
    background: rgba(28, 38, 61, 0.72);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.aff-auth-glass-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.aff-auth-glass-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(148, 163, 184);
}

.aff-auth-glass-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgb(74, 222, 128);
    background: rgba(22, 163, 74, 0.16);
    border: 1px solid rgba(22, 163, 74, 0.35);
    padding: 0.22rem 0.6rem;
    border-radius: 9999px;
}

.aff-auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.aff-auth-metric {
    background: rgba(11, 15, 25, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 0.8rem 0.65rem;
    text-align: center;
}

.aff-auth-metric-val {
    display: block;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 1.25rem;
    font-weight: 800;
    color: rgb(255, 255, 255);
    line-height: 1.2;
}

.aff-auth-metric-val.is-indigo {
    color: rgb(165, 180, 252);
}

.aff-auth-metric-val.is-amber {
    color: rgb(255, 176, 32);
}

.aff-auth-metric-val.is-emerald {
    color: rgb(74, 222, 128);
}

.aff-auth-metric-lbl {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: rgb(148, 163, 184);
}

.aff-auth-snippet {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    background: rgb(11, 15, 25);
    border: 1px solid rgb(40, 48, 68);
    border-radius: 10px;
    padding: 0.55rem 0.6rem 0.55rem 0.85rem;
}

.aff-auth-snippet code {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.8rem;
    color: rgb(226, 232, 240);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aff-auth-copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.72rem;
    border-radius: 7px;
    border: 1px solid rgba(91, 75, 255, 0.45);
    background: rgba(91, 75, 255, 0.2);
    color: rgb(224, 231, 255);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.aff-auth-copy-btn:hover {
    background: rgb(91, 75, 255);
    border-color: rgb(91, 75, 255);
    color: rgb(255, 255, 255);
}

.aff-auth-copy-btn.is-copied {
    background: rgba(22, 163, 74, 0.25);
    border-color: rgb(22, 163, 74);
    color: rgb(134, 239, 172);
}

/* Emerald Checkmark Perks List */
.aff-auth-perks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.aff-auth-perks li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: rgb(226, 232, 240);
}

.aff-auth-perks li i {
    color: rgb(74, 222, 128);
    font-size: 0.95rem;
    margin-top: 0.18rem;
    flex-shrink: 0;
}

.aff-auth-brand-footer {
    position: relative;
    z-index: 2;
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: rgb(148, 163, 184);
}

.aff-auth-brand-footer span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.aff-auth-brand-footer i {
    color: rgb(255, 176, 32);
}

/* ---- Right Form Workspace ---- */
.aff-auth-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}

@media (min-width: 640px) {
    .aff-auth-stage {
        padding: 3rem 2rem;
    }
}

.aff-auth-card {
    width: 100%;
    max-width: 560px;
    background: var(--aff-a-card);
    border: 1px solid var(--aff-a-border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: var(--aff-a-shadow);
}

.aff-auth-card.is-login {
    max-width: 460px;
}

@media (min-width: 640px) {
    .aff-auth-card {
        padding: 2.35rem 2.25rem;
    }
}

.aff-auth-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.aff-auth-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.72rem;
    border-radius: 9999px;
    background: rgba(91, 75, 255, 0.1);
    color: rgb(91, 75, 255);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

[data-theme="dark"] .aff-auth-tag {
    background: rgba(91, 75, 255, 0.2);
    color: rgb(165, 180, 252);
}

.aff-auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--aff-a-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.aff-auth-back-link:hover {
    color: rgb(91, 75, 255);
}

[data-theme="dark"] .aff-auth-back-link:hover {
    color: rgb(165, 180, 252);
}

.aff-auth-header {
    margin-bottom: 1.5rem;
}

.aff-auth-header h2 {
    margin: 0 0 0.4rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--aff-a-text);
}

.aff-auth-header p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--aff-a-muted);
}

/* Alerts */
.aff-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 1.15rem;
    border: 1px solid transparent;
}

.aff-alert i {
    margin-top: 0.16rem;
    flex-shrink: 0;
}

.aff-alert.is-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.28);
    color: rgb(185, 28, 28);
}

[data-theme="dark"] .aff-alert.is-error {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.32);
    color: rgb(252, 165, 165);
}

.aff-alert.is-success {
    background: rgba(22, 163, 74, 0.09);
    border-color: rgba(22, 163, 74, 0.3);
    color: rgb(21, 128, 61);
}

[data-theme="dark"] .aff-alert.is-success {
    background: rgba(22, 163, 74, 0.16);
    border-color: rgba(22, 163, 74, 0.35);
    color: rgb(134, 239, 172);
}

.aff-alert.is-warning {
    flex-direction: column;
    gap: 0.65rem;
    background: rgba(255, 176, 32, 0.1);
    border-color: rgba(255, 176, 32, 0.38);
    color: rgb(146, 64, 14);
}

[data-theme="dark"] .aff-alert.is-warning {
    background: rgba(255, 176, 32, 0.12);
    border-color: rgba(255, 176, 32, 0.32);
    color: rgb(253, 230, 138);
}

.aff-alert-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(180, 83, 9, 0.35);
    background: rgb(255, 176, 32);
    color: rgb(15, 23, 42);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.aff-alert-inline-btn:hover {
    filter: brightness(0.95);
}

/* Form Layout & Fields */
.aff-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.aff-form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 580px) {
    .aff-form-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.aff-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.aff-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.aff-field label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--aff-a-text);
}

.aff-field-opt {
    font-weight: 500;
    color: var(--aff-a-subtle);
    font-size: 0.78rem;
}

.aff-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.aff-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aff-a-subtle);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.15s ease;
}

.aff-input-wrap.is-textarea .aff-input-icon {
    top: 0.92rem;
    transform: none;
}

.aff-input-wrap input,
.aff-input-wrap textarea {
    width: 100%;
    background: var(--aff-a-input);
    color: var(--aff-a-text);
    border: 1px solid var(--aff-a-border);
    border-radius: 11px;
    padding: 0.68rem 0.9rem 0.68rem 2.5rem;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.45;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.aff-input-wrap.has-toggle input {
    padding-right: 2.65rem;
}

.aff-input-wrap input {
    height: 44px;
}

.aff-input-wrap textarea {
    min-height: 86px;
    resize: vertical;
}

.aff-input-wrap input::placeholder,
.aff-input-wrap textarea::placeholder {
    color: var(--aff-a-subtle);
    opacity: 0.85;
}

.aff-input-wrap input:focus,
.aff-input-wrap textarea:focus {
    outline: none;
    border-color: rgb(91, 75, 255);
    box-shadow: 0 0 0 3px rgba(91, 75, 255, 0.16);
    background: var(--aff-a-card);
}

.aff-input-wrap:focus-within .aff-input-icon {
    color: rgb(91, 75, 255);
}

[data-theme="dark"] .aff-input-wrap:focus-within .aff-input-icon {
    color: rgb(165, 180, 252);
}

.aff-eye-btn {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--aff-a-subtle);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.aff-eye-btn:hover {
    color: var(--aff-a-text);
    background: rgba(91, 75, 255, 0.08);
}

.aff-field-hint {
    margin: 0;
    font-size: 0.77rem;
    line-height: 1.45;
    color: var(--aff-a-subtle);
}

/* Password strength meter (paired with public/js/auth.js) */
.aff-auth-shell .password-meter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.aff-auth-shell .password-meter span {
    height: 4px;
    border-radius: 9999px;
    background: var(--aff-a-border);
    transition: background-color 0.2s ease;
}

.aff-auth-shell .password-meter[data-score="1"] span:nth-child(1) {
    background: rgb(239, 68, 68);
}

.aff-auth-shell .password-meter[data-score="2"] span:nth-child(-n+2) {
    background: rgb(255, 176, 32);
}

.aff-auth-shell .password-meter[data-score="3"] span:nth-child(-n+3) {
    background: rgb(91, 75, 255);
}

.aff-auth-shell .password-meter[data-score="4"] span {
    background: rgb(22, 163, 74);
}

/* Checkboxes & Links Row */
.aff-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.aff-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.84rem;
    line-height: 1.45;
    color: var(--aff-a-muted);
    cursor: pointer;
}

.aff-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin-top: 0.14rem;
    border-radius: 5px;
    accent-color: rgb(91, 75, 255);
    flex-shrink: 0;
    cursor: pointer;
}

.aff-check a,
.aff-inline-link {
    color: rgb(91, 75, 255);
    font-weight: 600;
    text-decoration: none;
}

[data-theme="dark"] .aff-check a,
[data-theme="dark"] .aff-inline-link {
    color: rgb(165, 180, 252);
}

.aff-check a:hover,
.aff-inline-link:hover {
    text-decoration: underline;
}

/* Turnstile Box */
.aff-turnstile-wrap {
    padding: 0.7rem;
    border-radius: 12px;
    background: var(--aff-a-input);
    border: 1px solid var(--aff-a-border);
    display: flex;
    justify-content: center;
}

.aff-turnstile-wrap.is-required {
    border-color: rgb(239, 68, 68);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Submit Button */
.aff-auth-submit {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgb(91, 75, 255) 0%, rgb(65, 41, 231) 100%);
    color: rgb(255, 255, 255);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 10px 24px -6px rgba(91, 75, 255, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.aff-auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px -6px rgba(91, 75, 255, 0.55);
    filter: brightness(1.04);
}

.aff-auth-submit:active {
    transform: translateY(0);
}

.aff-auth-submit.is-loading {
    opacity: 0.78;
    cursor: wait;
}

.aff-auth-foot {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--aff-a-border);
    text-align: center;
    font-size: 0.88rem;
    color: var(--aff-a-muted);
}

.aff-auth-foot a {
    color: rgb(91, 75, 255);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.25rem;
}

[data-theme="dark"] .aff-auth-foot a {
    color: rgb(165, 180, 252);
}

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

@media (max-width: 480px) {
    .aff-auth-metrics {
        grid-template-columns: 1fr;
    }

    .aff-auth-brand {
        padding: 2.25rem 1.25rem;
    }
}

