:root {
    --aff-primary: #3b4a6b;
    --aff-primary-dark: #2c3650;
    --aff-accent: #4f8cff;
    --aff-bg: #f4f6fb;
    --aff-card: #ffffff;
    --aff-border: #e3e8f0;
    --aff-text: #22283a;
    --aff-muted: #6b7488;
    --aff-ok: #1f9d55;
    --aff-warn: #b7791f;
    --aff-danger: #d1435b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--aff-bg);
    color: var(--aff-text);
    line-height: 1.5;
}

a {
    color: var(--aff-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── Auth-Seiten (Login/Registrierung/Reset) ─────────────────────────── */
body.aff-auth-photo {
    background: #120818;
}

body.aff-auth-photo::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url("/affiliate/assets/img/affiliate-auth-bg.jpg") center center / cover no-repeat;
}

.aff-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--aff-primary) 0%, var(--aff-primary-dark) 100%);
}

body.aff-auth-photo .aff-auth-wrap {
    background: transparent;
}

.aff-auth-stack {
    width: 100%;
    max-width: 440px;
}

.aff-auth-stack-wide {
    max-width: 640px;
}

.aff-auth-lang {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.aff-auth-lang .lp-lang-toggle {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(10, 8, 20, 0.45);
}

.aff-auth-card {
    width: 100%;
    max-width: none;
    background: var(--aff-card);
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.aff-auth-head {
    padding: 28px 28px 10px;
    text-align: center;
}

.aff-auth-head h1 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}

.aff-auth-head p {
    margin: 0;
    color: var(--aff-muted);
    font-size: 0.92rem;
}

.aff-auth-body {
    padding: 18px 28px 28px;
}

.aff-auth-foot {
    padding: 0 28px 24px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--aff-muted);
}

/* ─── Formulare ───────────────────────────────────────────────────────── */
.aff-field {
    margin-bottom: 16px;
}

.aff-field label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.aff-accept {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400;
}

.aff-accept input {
    margin-top: 4px;
}

.aff-alert[hidden] {
    display: none;
}

.aff-field[hidden] {
    display: none;
}

.aff-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    border: 2px solid var(--aff-border);
    border-radius: 10px;
    background: #fafbfe;
    transition: border-color 0.15s ease;
}

.aff-input:focus {
    outline: none;
    border-color: var(--aff-accent);
    background: #fff;
}

.aff-input.is-invalid {
    border-color: var(--aff-danger);
}

.aff-input-group {
    display: flex;
}

.aff-input-group .aff-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.aff-input-group button {
    border: 2px solid var(--aff-border);
    border-left: 0;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    background: #eef1f8;
    padding: 0 14px;
    cursor: pointer;
}

.aff-error-text {
    color: var(--aff-danger);
    font-size: 0.82rem;
    margin-top: 4px;
}

.aff-btn {
    display: inline-block;
    width: 100%;
    padding: 13px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--aff-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s ease;
}

.aff-btn:hover {
    background: var(--aff-primary-dark);
    text-decoration: none;
    color: #fff;
}

.aff-btn-sm {
    width: auto;
    padding: 8px 14px;
    font-size: 0.88rem;
}

.aff-btn-light {
    background: #eef1f8;
    color: var(--aff-primary);
}

.aff-btn-light:hover {
    background: #e2e7f3;
    color: var(--aff-primary);
}

/* ─── Meldungen ───────────────────────────────────────────────────────── */
.aff-alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.92rem;
    border: 1px solid transparent;
}

.aff-alert-success { background: #e6f6ec; border-color: #bce3c9; color: #166534; }
.aff-alert-info    { background: #e7f0fe; border-color: #bcd4f7; color: #1e478e; }
.aff-alert-warning { background: #fdf3e3; border-color: #f0dcae; color: #8a5a12; }
.aff-alert-danger  { background: #fbe7eb; border-color: #f2c2cd; color: #a12338; }

/* ─── App-Layout (eingeloggt) ─────────────────────────────────────────── */
.aff-topbar {
    background: var(--aff-primary);
    color: #fff;
}

.aff-topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

.aff-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.aff-brand:hover {
    text-decoration: none;
    color: #fff;
}

.aff-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.aff-nav a {
    color: #d8e0f2;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.92rem;
}

.aff-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

.aff-nav a.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.aff-main {
    max-width: 1040px;
    margin: 24px auto;
    padding: 0 20px;
}

.aff-page-title {
    font-size: 1.5rem;
    margin: 0 0 18px;
}

.aff-card {
    background: var(--aff-card);
    border: 1px solid var(--aff-border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
}

.aff-card h2 {
    font-size: 1.1rem;
    margin: 0 0 12px;
}

.aff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.aff-stat {
    background: var(--aff-card);
    border: 1px solid var(--aff-border);
    border-radius: 14px;
    padding: 16px 18px;
}

.aff-stat .label {
    color: var(--aff-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.aff-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 4px;
}

/* ─── Code-Box ────────────────────────────────────────────────────────── */
.aff-code-box {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.aff-code {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: #eef1f8;
    border: 1px dashed var(--aff-border);
    border-radius: 10px;
    padding: 10px 18px;
    color: var(--aff-primary);
}

/* ─── Tabellen ────────────────────────────────────────────────────────── */
.aff-table-wrap {
    overflow-x: auto;
}

.aff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.aff-table th,
.aff-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--aff-border);
    white-space: nowrap;
}

.aff-table th {
    color: var(--aff-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.aff-table tbody tr:hover {
    background: #f8faff;
}

.aff-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.aff-badge-ok      { background: #e6f6ec; color: #166534; }
.aff-badge-pending { background: #fdf3e3; color: #8a5a12; }
.aff-badge-muted   { background: #eef1f8; color: #566; }
.aff-badge-danger  { background: #fbe7eb; color: #a12338; }

.aff-product-list {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aff-product-list li {
    display: grid;
    grid-template-columns: minmax(160px, 2fr) repeat(3, minmax(120px, 1fr));
    gap: 12px 20px;
    align-items: start;
    padding: 14px 16px;
    border: 1px solid var(--aff-border);
    border-radius: 12px;
    background: #fafbfe;
}

.aff-product-name {
    font-weight: 700;
}

.aff-product-label {
    display: block;
    color: var(--aff-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.aff-product-list small {
    display: block;
    color: var(--aff-muted);
    font-size: 0.8rem;
}

.aff-empty {
    color: var(--aff-muted);
    padding: 24px 4px;
    text-align: center;
}

.aff-muted {
    color: var(--aff-muted);
}

.aff-hint {
    font-size: 0.85rem;
    color: var(--aff-muted);
    margin-top: 8px;
}

.aff-copied {
    color: var(--aff-ok);
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 800px) {
    .aff-product-list li {
        grid-template-columns: 1fr 1fr;
    }

    .aff-product-name {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .aff-topbar-inner {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .aff-product-list li {
        grid-template-columns: 1fr;
    }
}
