/*
 * AP-09 Stufe A – Registrierungs-Wizard (Zugangsdaten -> Profil -> Fertig).
 * Vorlage: Resources/Private/Planning/Vorlage_Registrierung_2026-09.html
 * Layout/UX 1:1, Typografie auf die Site-Fonts gemappt (Lato = inherit, Montserrat fuer Titel).
 * Geladen per AssetCollector im UserController (nur Registrierungs-/Konto-Seiten).
 * Alle Selektoren sind unter .reg gescoped, Klassen-Prefix "reg-".
 */

.reg {
    --reg-primary: #1f3c68;
    --reg-primary-hover: #2f5da0;
    --reg-primary-soft: #f2f5fa;
    --reg-text: #1b2430;
    --reg-text-soft: #3b4655;
    --reg-muted: #6b7788;
    --reg-muted-light: #8792a2;
    --reg-border: #c3cad4;
    --reg-border-light: #dfe3e9;
    --reg-bg: #eceef1;
    --reg-bg-soft: #f1f3f7;
    --reg-white: #fff;
    --reg-error: #b4231f;
    --reg-error-dark: #8e1c19;
    --reg-error-bg: #fdf1f0;
    --reg-success: #1d7a48;
    --reg-success-dark: #1c5637;
    --reg-success-bg: #f0f6f2;
    --reg-warn: #c98016;
    --reg-warn-dark: #7a4d09;
    --reg-warn-bg: #fff8ec;
    --reg-good: #4f8a2e;
    --reg-disabled: #b8c1cd;
    --reg-radius: 3px;
    --reg-font-title: 'Montserrat', sans-serif;

    color: var(--reg-text);
    line-height: 1.45;
}

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

.reg a {
    color: var(--reg-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reg a:hover,
.reg a:focus {
    color: var(--reg-primary-hover);
}

@keyframes reg-pop {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

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

/* ---------- Layout ---------- */

.reg-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin: 12px 0 40px;
}

@media (min-width: 1024px) {
    .reg-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 32px;
    }
    .reg-aside__inner {
        position: sticky;
        top: 24px;
    }
}

.reg-aside:empty {
    display: none;
}

.reg-aside__inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ---------- Card ---------- */

.reg-card {
    background: var(--reg-white);
    border: 1px solid var(--reg-border-light);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(27, 36, 48, 0.06);
}

.reg-card__head {
    padding: 28px 24px 0;
}

.reg-card__body,
.reg-form {
    padding: 26px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

@media (min-width: 600px) {
    .reg-card__head { padding: 32px 40px 0; }
    .reg-card__body,
    .reg-form { padding: 30px 40px 40px; gap: 26px; }
}

.reg-title {
    font-family: var(--reg-font-title);
    font-weight: 700;
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--reg-text);
}

@media (min-width: 600px) {
    .reg-title { font-size: 42px; }
}

.reg-lead {
    margin: 0;
    color: var(--reg-muted);
    font-size: 16px;
    max-width: 52ch;
}

.reg-subtitle {
    font-family: var(--reg-font-title);
    font-weight: 700;
    font-size: 22px;
    text-transform: uppercase;
    margin: 0 0 4px;
    color: var(--reg-text);
}

.reg-text {
    margin: 0;
    font-size: 16px;
    color: var(--reg-text-soft);
    max-width: 62ch;
}

.reg-text--muted {
    color: var(--reg-muted);
    font-size: 15px;
    margin-top: -18px;
}

.reg-divider {
    border: 0;
    height: 1px;
    background: var(--reg-bg);
    margin: 4px 0;
}

/* ---------- Stepper ---------- */

.reg-stepper {
    list-style: none;
    margin: 0;
    padding: 26px 24px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

@media (min-width: 600px) {
    .reg-stepper { padding: 26px 40px 0; gap: 20px; }
}

.reg-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.reg-step__mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--reg-white);
    color: var(--reg-muted-light);
    border: 2px solid var(--reg-border-light);
}

.reg-step__label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--reg-muted-light);
}

.reg-step__optional {
    font-weight: 500;
}

.reg-step.is-active .reg-step__mark {
    background: var(--reg-primary);
    border-color: var(--reg-primary);
    color: var(--reg-white);
}

.reg-step.is-active .reg-step__label {
    color: var(--reg-text);
}

.reg-step.is-done .reg-step__mark {
    background: var(--reg-success);
    border-color: var(--reg-success);
    color: var(--reg-white);
}

.reg-step.is-done .reg-step__label {
    color: var(--reg-success);
}

.reg-step__line {
    width: 28px;
    height: 2px;
    flex: none;
    background: #e3e7ec;
}

.reg-step__line.is-done {
    background: var(--reg-success);
}

/* ---------- Fields ---------- */

.reg-field {
    margin: 0;
}

.reg-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--reg-text);
}

.reg-req {
    color: var(--reg-error);
}

.reg .reg-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    margin: 0;
    font-size: 16px;
    font-family: inherit;
    line-height: normal;
    color: var(--reg-text);
    background: var(--reg-white);
    border: 1px solid var(--reg-border);
    border-radius: var(--reg-radius);
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.12s, box-shadow 0.12s;
}

.reg .reg-select {
    background-image: linear-gradient(45deg, transparent 50%, var(--reg-muted) 50%), linear-gradient(135deg, var(--reg-muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 40px;
}

.reg .reg-input:focus {
    border-color: var(--reg-primary);
    box-shadow: 0 0 0 3px rgba(31, 60, 104, 0.12);
}

.reg .reg-input::placeholder {
    color: var(--reg-muted-light);
    opacity: 1;
}

.reg .reg-input--icon {
    padding-right: 44px;
}

.reg .reg-input--toggle {
    padding-right: 96px;
}

.reg-field.has-error .reg-input,
.reg .reg-input.is-invalid {
    border-color: var(--reg-error);
}

.reg-field.has-error .reg-input:focus,
.reg .reg-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 31, 0.12);
}

.reg .reg-input.is-valid {
    border-color: var(--reg-success);
}

.reg-input-wrap {
    position: relative;
}

.reg-input-status {
    position: absolute;
    right: 14px;
    top: 13px;
    font-size: 18px;
    line-height: 22px;
    color: var(--reg-muted-light);
    pointer-events: none;
}

.reg-input-status.is-free { color: var(--reg-success); }
.reg-input-status.is-taken,
.reg-input-status.is-invalid { color: var(--reg-error); }

.reg-input-status.is-checking::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-top: 3px;
    border: 2px solid var(--reg-border-light);
    border-top-color: var(--reg-primary);
    border-radius: 50%;
    animation: reg-spin 0.7s linear infinite;
}

.reg .reg-pw-toggle {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 32px;
    padding: 0 10px;
    margin: 0;
    background: var(--reg-bg-soft);
    border: 1px solid var(--reg-border-light);
    border-radius: var(--reg-radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 30px;
    color: var(--reg-primary);
    cursor: pointer;
    text-transform: none;
}

.reg .reg-pw-toggle:hover,
.reg .reg-pw-toggle:focus {
    border-color: var(--reg-primary);
    background: var(--reg-primary-soft);
}

/* Hints / states below the field */

.reg-hint {
    margin-top: 7px;
    font-size: 14px;
    min-height: 0;
}

.reg-hint:empty {
    display: none;
}

.reg-hint--split {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}

.reg-error {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: var(--reg-error);
    animation: reg-pop 0.16s ease-out;
}

.reg-error::before {
    content: '!';
    font-weight: 700;
    flex: none;
}

.reg-ok {
    display: block;
    color: var(--reg-success);
    font-weight: 600;
    animation: reg-pop 0.16s ease-out;
}

.reg-info {
    display: block;
    color: var(--reg-muted);
}

.reg-typo {
    display: block;
    color: var(--reg-muted);
    animation: reg-pop 0.16s ease-out;
}

.reg .reg-typo__accept {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--reg-primary);
    text-decoration: underline;
    cursor: pointer;
    text-transform: none;
}

.reg-note {
    margin-top: 6px;
    font-size: 13px;
    color: var(--reg-muted-light);
}

.reg-suggestions {
    margin-top: 9px;
    padding: 12px 14px;
    background: var(--reg-error-bg);
    border-left: 3px solid var(--reg-error);
    animation: reg-pop 0.16s ease-out;
}

.reg-suggestions__label {
    display: block;
    font-size: 14px;
    color: var(--reg-error-dark);
    font-weight: 600;
    margin-bottom: 8px;
}

.reg .reg-chip {
    display: inline-block;
    background: var(--reg-white);
    border: 1px solid var(--reg-border);
    border-radius: 999px;
    padding: 6px 14px;
    margin: 0 8px 8px 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--reg-primary);
    cursor: pointer;
    text-transform: none;
}

.reg .reg-chip:hover,
.reg .reg-chip:focus {
    border-color: var(--reg-primary);
    background: var(--reg-primary-soft);
}

/* Password strength */

.reg-strength {
    display: flex;
    gap: 4px;
    margin-top: 9px;
}

.reg-strength__bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: #e7eaef;
    transition: background-color 0.15s;
}

.reg-strength[data-level="1"] .reg-strength__bar:nth-child(-n+1) { background: var(--reg-error); }
.reg-strength[data-level="2"] .reg-strength__bar:nth-child(-n+2) { background: var(--reg-warn); }
.reg-strength[data-level="3"] .reg-strength__bar:nth-child(-n+3) { background: var(--reg-good); }
.reg-strength[data-level="4"] .reg-strength__bar:nth-child(-n+4) { background: var(--reg-success); }

.reg-strength__text {
    color: var(--reg-muted);
}

.reg-strength__label {
    font-weight: 700;
    white-space: nowrap;
}

.reg-strength__label[data-level="1"] { color: var(--reg-error); }
.reg-strength__label[data-level="2"] { color: var(--reg-warn); }
.reg-strength__label[data-level="3"] { color: var(--reg-good); }
.reg-strength__label[data-level="4"] { color: var(--reg-success); }

/* Checkboxes */

.reg-consent {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
}

.reg .reg-check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

/* Das Site-CSS (main.scss: body, * { appearance: none }) entfernt das native Checkbox-Rendering
   und input:not(...) setzt border/background/line-height. Hier wird die native Checkbox
   zurueckgeholt, accent-color faerbt den Haken in der Primaerfarbe. */
.reg .reg-check__input {
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: auto;
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: normal;
    flex: none;
    accent-color: var(--reg-primary);
    cursor: pointer;
}

.reg .reg-check__input:focus-visible {
    outline: 2px solid var(--reg-primary);
    outline-offset: 2px;
}

.reg-check__text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--reg-text-soft);
}

.reg-check--row {
    padding: 11px 0;
    border-bottom: 1px solid #f2f4f7;
}

.reg-check--row .reg-check__text {
    font-size: 15px;
}

.reg-field--check.has-error .reg-check__text {
    color: var(--reg-error-dark);
}

.reg-prefs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Rows */

.reg-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 600px) {
    .reg-row--2 { grid-template-columns: 1fr 1fr; }
    .reg-row--2-1 { grid-template-columns: 2fr 1fr; }
    .reg-field--full { grid-column: 1 / -1; }
}

/* Details "Adresse und Homepage" */

.reg-more {
    margin-top: -6px;
}

.reg-more__toggle {
    list-style: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--reg-primary);
    text-decoration: underline;
    margin-bottom: 18px;
}

.reg-more__toggle::-webkit-details-marker {
    display: none;
}

.reg-more:not([open]) .reg-more__opened,
.reg-more[open] .reg-more__closed {
    display: none;
}

/* Roles */

.reg-roles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reg .reg-role {
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.reg .reg-role__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.reg-role__label {
    display: inline-block;
    padding: 12px 18px;
    border-radius: var(--reg-radius);
    font-size: 15px;
    font-weight: 600;
    background: var(--reg-white);
    color: var(--reg-text-soft);
    border: 1px solid var(--reg-border);
    transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.reg .reg-role__input:checked + .reg-role__label {
    background: var(--reg-primary);
    color: var(--reg-white);
    border-color: var(--reg-primary);
}

.reg .reg-role__input:focus-visible + .reg-role__label {
    box-shadow: 0 0 0 3px rgba(31, 60, 104, 0.2);
}

.reg-role-warning {
    margin-top: -14px;
}

/* ---------- Notices ---------- */

.reg-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 18px;
    padding: 14px 16px;
    font-size: 15px;
    border-left: 3px solid var(--reg-border);
    background: var(--reg-bg-soft);
    color: var(--reg-text-soft);
}

.reg-notice--success {
    background: var(--reg-success-bg);
    border-left-color: var(--reg-success);
    color: var(--reg-success-dark);
}

.reg-notice--warn {
    background: var(--reg-warn-bg);
    border-left-color: var(--reg-warn);
    color: var(--reg-warn-dark);
    font-size: 14px;
}

.reg-notice--error {
    background: var(--reg-error-bg);
    border-left-color: var(--reg-error);
    color: var(--reg-error-dark);
}

.reg-notice__body {
    flex: 1 1 320px;
}

.reg-notice__form {
    margin: 0;
}

.reg-notice[hidden] {
    display: none;
}

/* ---------- Buttons ---------- */

.reg .reg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 32px;
    margin: 0;
    border-radius: var(--reg-radius);
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    text-transform: none;
    transition: background-color 0.12s, border-color 0.12s;
}

.reg .reg-btn--primary {
    background: var(--reg-primary);
    color: var(--reg-white);
    border: 0;
}

.reg .reg-btn--primary:hover,
.reg .reg-btn--primary:focus {
    background: var(--reg-primary-hover);
    color: var(--reg-white);
}

.reg .reg-btn--primary.is-pending {
    background: var(--reg-disabled);
}

.reg .reg-btn--primary[disabled] {
    background: var(--reg-disabled);
    cursor: progress;
}

.reg .reg-btn--secondary {
    background: var(--reg-white);
    color: var(--reg-primary);
    border: 1px solid var(--reg-border);
    font-size: 16px;
    font-weight: 600;
    height: 50px;
    padding: 0 22px;
}

.reg .reg-btn--secondary:hover,
.reg .reg-btn--secondary:focus {
    border-color: var(--reg-primary);
    background: var(--reg-primary-soft);
}

.reg .reg-link-btn {
    display: inline;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: var(--reg-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    text-transform: none;
}

.reg .reg-link-btn:hover,
.reg .reg-link-btn:focus {
    color: var(--reg-primary-hover);
}

.reg-actions {
    display: flex;
    align-items: center;
    gap: 14px 18px;
    flex-wrap: wrap;
}

.reg-actions__note {
    font-size: 14px;
    color: var(--reg-muted);
}

.reg-actions__note:empty {
    display: none;
}

.reg-footnote {
    border-top: 1px solid var(--reg-bg);
    padding-top: 18px;
    font-size: 14px;
    color: var(--reg-muted);
}

.reg-inline-form {
    display: inline;
    margin: 0;
}

/* ---------- Done page ---------- */

.reg-done__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--reg-success);
    color: var(--reg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: -6px;
}

.reg-done__icon--error {
    background: var(--reg-error);
}

.reg-done__title {
    font-family: var(--reg-font-title);
    font-weight: 700;
    font-size: 30px;
    text-transform: uppercase;
    margin: 0;
    color: var(--reg-text);
}

/* ---------- Sidebar boxes ---------- */

.reg-box {
    background: var(--reg-white);
    border: 1px solid var(--reg-border-light);
    border-radius: 4px;
    padding: 20px 22px;
}

.reg-box--dark {
    background: var(--reg-primary);
    border-color: var(--reg-primary);
    color: var(--reg-white);
    padding: 22px 22px 24px;
}

.reg-box--accent {
    background: var(--reg-success-bg);
    border-color: var(--reg-success);
    color: var(--reg-success-dark);
}

.reg-box__title {
    font-family: var(--reg-font-title);
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.reg-box__title--small {
    font-family: inherit;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.reg-box__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--reg-muted);
}

.reg-box--accent .reg-box__text {
    color: var(--reg-success-dark);
}

.reg-box__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    font-size: 15px;
    line-height: 1.35;
    opacity: 0.92;
}

.reg-box__list li::before {
    content: '\2713';
    display: inline-block;
    width: 1.4em;
    opacity: 0.8;
}

/* ---------- Honeypot ---------- */

.reg-hp {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .reg-error,
    .reg-ok,
    .reg-typo,
    .reg-suggestions {
        animation: none;
    }
    .reg-input-status.is-checking::before {
        animation-duration: 1.5s;
    }
}
