/* Runde 3 – Team T1: "Mein Auftritt" (/profile) und Gast-Mail-Studio (/profile/mail-studio).
   site.css gehört T6; hier nur eigene Klassen (t1-*). Fallbacks für T6-Komponenten
   (a4f-chip--premium, a4f-stepper, a4f-sheet) sind auf t1-Klassen gelegt, damit T6-Styles gewinnen
   können, ohne dass hier etwas bricht. */

/* ---------- shared bits ---------- */
.t1-btn-tap {
    min-height: var(--tap-target-min, 44px);
}

.t1-btn-block {
    width: 100%;
}

.t1-link-btn {
    min-height: var(--tap-target-min, 44px);
    padding: 0.25rem 0.25rem;
    color: var(--white-dim, #a0a0a0);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: var(--font-body, monospace);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.875rem;
}

.t1-link-btn:hover,
.t1-link-btn:focus-visible {
    color: var(--white, #e8e8e8);
}

.t1-field-error {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    color: #ff8a8a;
    min-height: 0;
}

.t1-field-error:empty {
    display: none;
}

[aria-invalid="true"] {
    border-color: #ff8a8a !important;
}

.t1-chip-premium {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--accent, #ff6b00);
    border-radius: 999px;
    background: var(--accent, #ff6b00);
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.3;
    white-space: nowrap;
}

/* ---------- Teaser fallback (T6 _LockedTeaser replaces it) ---------- */
.t1-teaser {
    padding: 1rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    border-left: 3px solid var(--accent, #ff6b00);
    background: rgba(255, 107, 0, 0.06);
}

.t1-teaser__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.t1-teaser__title {
    font-size: 1rem;
}

.t1-teaser__text {
    margin: 0 0 0.75rem;
    color: var(--white-dim, #a0a0a0);
    font-size: 0.875rem;
}

.t1-teaser__cta {
    min-height: var(--tap-target-min, 44px);
}

/* =====================================================================
   /profile – "Mein Auftritt"
   ===================================================================== */
.t1-profile {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr);
}

.t1-profile__col {
    display: grid;
    gap: 1.25rem;
    align-content: start;
    min-width: 0;
}

@media (min-width: 992px) {
    .t1-profile {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: start;
    }

    .t1-mailcard {
        position: sticky;
        top: 1rem;
    }
}

.t1-card .card-body {
    padding: 1.25rem;
}

@media (min-width: 576px) {
    .t1-card .card-body {
        padding: 1.5rem;
    }
}

.t1-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.t1-card__title {
    margin: 0 0 1rem;
    font-family: var(--font-display, sans-serif);
    font-size: 1.35rem;
    letter-spacing: 0.06em;
}

.t1-card__head .t1-card__title {
    margin: 0;
}

.t1-card__text {
    color: var(--white-dim, #a0a0a0);
    font-size: 0.875rem;
}

.t1-card__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.t1-avatar-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-dark, #2a2a2a);
}

.t1-avatar {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 50%;
}

.t1-avatar-row__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    min-width: 0;
}

.t1-avatar-row__actions form {
    margin: 0;
}

.t1-avatar-row__actions .form-text {
    flex-basis: 100%;
}

.t1-inline-save {
    display: flex;
    gap: 0.5rem;
}

.t1-inline-save .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

.t1-counter-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.t1-counter-row > :last-child {
    white-space: nowrap;
}

/* Mini preview of the guest email (colors from the stored look) */
.t1-thumb {
    display: block;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    background: var(--t1-bg, #0a0a0a);
    text-decoration: none;
}

.t1-thumb__mail {
    display: grid;
    gap: 0.45rem;
    max-width: 260px;
    margin: 0 auto;
    padding: 0.9rem;
    background: color-mix(in srgb, var(--t1-bg, #0a0a0a) 88%, #808080);
    border-radius: 4px;
}

.t1-thumb__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    margin-bottom: 0.2rem;
}

.t1-thumb__logo img {
    max-height: 36px;
    max-width: 140px;
}

.t1-thumb__initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--t1-acc, #ff6b00);
    color: var(--t1-on-acc, #0a0a0a);
    font-weight: 700;
}

.t1-thumb__line {
    display: block;
    height: 6px;
    width: 70%;
    border-radius: 3px;
    background: color-mix(in srgb, var(--t1-bg, #0a0a0a) 55%, #9a9a9a);
}

.t1-thumb__line--wide {
    width: 90%;
    height: 8px;
}

.t1-thumb__line--short {
    width: 45%;
}

.t1-thumb__button {
    display: block;
    height: 22px;
    width: 55%;
    margin-top: 0.3rem;
    background: var(--t1-acc, #ff6b00);
}

.t1-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0;
    padding: 0;
    margin: 0 0 0.75rem;
    list-style: none;
    font-size: 0.875rem;
    color: var(--white-dim, #a0a0a0);
}

.t1-status li + li::before {
    content: "·";
    margin: 0 0.5rem;
    color: var(--gray-light, #666);
}

.t1-status li.is-on {
    color: var(--white, #e8e8e8);
}

.t1-status li.is-on [aria-hidden="true"] {
    color: var(--success, #22c55e);
}

/* =====================================================================
   Guest email studio
   ===================================================================== */
.t1-studio__head {
    margin-bottom: 1.25rem;
}

.t1-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: var(--tap-target-min, 44px);
    color: var(--white-dim, #a0a0a0);
    text-decoration: none;
    font-size: 0.875rem;
}

.t1-back:hover,
.t1-back:focus-visible {
    color: var(--white, #e8e8e8);
}

.t1-studio__titlerow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.t1-studio__title {
    margin: 0;
}

.t1-chip-premium--filled {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
}

.t1-studio__intro {
    margin: 0.5rem 0 0.25rem;
    font-size: 1rem;
    color: var(--white, #e8e8e8);
    max-width: 60ch;
}

.t1-studio__note {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--white-dim, #a0a0a0);
}

.t1-studio .t1-teaser {
    margin-bottom: 1.25rem;
}

/* Stepper: own markup (label row, 4-column list, hint row). Not combined with T6's .a4f-stepper,
   whose flex row put label, list and hint side by side and cut the step names (R3 fix Q61). */
.t1-stepper {
    display: block;
    margin-bottom: 1.25rem;
}

.t1-stepper__label {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--white-dim, #a0a0a0);
}

.t1-stepper__list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.t1-stepper__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--tap-target-min, 44px);
    padding: 0.35rem 0.5rem;
    border-bottom: 3px solid var(--gray-dark, #2a2a2a);
    color: var(--white-dim, #a0a0a0);
    text-decoration: none;
    font-size: 0.8125rem;
    min-width: 0;
}

a.t1-stepper__link:hover {
    color: var(--white, #e8e8e8);
}

.t1-stepper__num {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--gray, #3a3a3a);
    font-size: 0.75rem;
}

.t1-stepper__name {
    /* Long names ("Vorschau & fertig") wrap instead of being cut off */
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.25;
}

.t1-stepper__item.is-done .t1-stepper__link {
    border-bottom-color: color-mix(in srgb, var(--accent, #ff6b00) 45%, transparent);
}

.t1-stepper__item.is-current .t1-stepper__link {
    border-bottom-color: var(--accent, #ff6b00);
    color: var(--white, #e8e8e8);
    font-weight: 700;
}

.t1-stepper__item.is-current .t1-stepper__num {
    background: var(--accent, #ff6b00);
    border-color: var(--accent, #ff6b00);
    color: #0a0a0a;
}

.t1-stepper__item.is-locked .t1-stepper__link {
    opacity: 0.65;
    cursor: not-allowed;
}

.t1-stepper__item.is-locked .t1-stepper__num {
    border-color: transparent;
}

.t1-stepper__hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--white-dim, #a0a0a0);
}

@media (max-width: 575.98px) {
    /* Phone: numbers only, the label above names the current step */
    .t1-stepper__name {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .t1-stepper__link {
        justify-content: center;
    }
}

/* Grid: step left, sticky live preview right */
.t1-studio__grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr);
}

.t1-studio__main {
    min-width: 0;
}

@media (min-width: 992px) {
    .t1-studio__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
        align-items: start;
    }

    /* Sticky and never taller than the window: tabs, subject and mail stay in view while the
       step on the left scrolls (the mail scrolls inside the frame) */
    .t1-preview {
        position: sticky;
        top: 1rem;
        display: flex;
        flex-direction: column;
        height: calc(100vh - 2rem);
        min-height: 560px;
    }

    .t1-preview .t1-preview__mail {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .t1-preview .t1-preview__frame {
        flex: 1 1 auto;
        height: auto;
        min-height: 320px;
    }

    .t1-preview-open,
    .t1-preview__close {
        display: none !important;
    }
}

.t1-step {
    padding: 1.25rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    background: var(--black-lighter, #1a1a1a);
}

@media (min-width: 576px) {
    .t1-step {
        padding: 1.5rem;
    }
}

.t1-step[hidden] {
    display: none !important;
}

.t1-step__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.t1-step__title {
    margin: 0;
    font-family: var(--font-display, sans-serif);
    font-size: 1.5rem;
    letter-spacing: 0.06em;
}

.t1-step__title:focus {
    outline: none;
}

.t1-step__text {
    color: var(--white-dim, #a0a0a0);
    font-size: 0.875rem;
}

.t1-step__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-dark, #2a2a2a);
}

.t1-step__actions form {
    margin: 0;
}

.t1-step__skip {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-target-min, 44px);
    color: var(--white, #e8e8e8);
    font-size: 0.875rem;
    text-underline-offset: 3px;
}

.t1-step__reset {
    margin-left: auto !important;
}

@media (max-width: 575.98px) {
    .t1-step__actions > .btn-primary,
    .t1-step__actions > form .btn-primary {
        width: 100%;
    }

    .t1-step__actions > form {
        width: 100%;
    }

    .t1-step__reset {
        margin-left: 0 !important;
    }
}

.t1-label {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: var(--white-dim, #a0a0a0);
}

/* Step 1: logo */
.t1-logo__current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    /* checkerboard shows the transparency of the PNG */
    background: repeating-conic-gradient(#2a2a2a 0% 25%, #1a1a1a 0% 50%) 50% / 16px 16px;
}

.t1-logo__img {
    max-width: 100%;
    max-height: 96px;
}

.t1-logo__img[hidden],
.t1-logo__empty[hidden] {
    display: none;
}

.t1-logo__empty {
    color: var(--white-dim, #a0a0a0);
    font-size: 0.875rem;
}

.t1-dropzone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding: 1.25rem 1rem;
    margin-bottom: 0.5rem;
    border: 2px dashed var(--gray, #3a3a3a);
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.t1-dropzone.is-dragover {
    border-color: var(--accent, #ff6b00);
    background: rgba(255, 107, 0, 0.08);
}

.t1-dropzone__btn {
    min-height: var(--tap-target-comfortable, 48px);
}

.t1-dropzone__or {
    font-size: 0.8125rem;
    color: var(--white-dim, #a0a0a0);
}

.t1-dropzone__busy {
    flex-basis: 100%;
    font-size: 0.8125rem;
}

.t1-dropzone__busy[hidden] {
    display: none;
}

@media (hover: none) {
    .t1-dropzone__or {
        display: none;
    }
}

/* Step 2: colors */
.t1-swatches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 576px) {
    .t1-swatches {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.t1-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-height: 64px;
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    background: transparent;
    color: var(--white-dim, #a0a0a0);
    font-size: 0.75rem;
    cursor: pointer;
}

.t1-swatch:hover,
.t1-swatch[aria-pressed="true"] {
    border-color: var(--accent, #ff6b00);
    color: var(--white, #e8e8e8);
}

.t1-swatch__chip {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, var(--t1-acc) 0 50%, var(--t1-bg) 50% 100%);
}

.t1-swatch__name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.t1-color {
    margin-bottom: 1rem;
}

.t1-color__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.t1-color__picker {
    flex-shrink: 0;
    width: 48px;
    height: 44px;
    padding: 2px;
    border: 1px solid var(--gray, #3a3a3a);
    background: transparent;
    cursor: pointer;
}

.t1-color__hex {
    max-width: 9rem;
    font-family: var(--font-mono, monospace);
}

.t1-contrast {
    min-height: 1.5rem;
}

.t1-contrast__ok {
    margin: 0;
    color: var(--success, #22c55e);
    font-size: 0.875rem;
}

.t1-contrast__ok[hidden],
.t1-hint[hidden] {
    display: none;
}

/* Neutral hint box (never red) */
.t1-hint {
    padding: 0.85rem 1rem;
    border: 1px solid var(--gray, #3a3a3a);
    border-left: 3px solid var(--cyan, #22d3ee);
    background: rgba(34, 211, 238, 0.06);
    font-size: 0.875rem;
}

.t1-hint--info {
    margin-bottom: 1rem;
}

.t1-hint__text {
    margin: 0 0 0.5rem;
    line-height: 1.55;
}

.t1-hint__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
}

.t1-suggest {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.t1-suggest__dot {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.t1-suggest code {
    color: var(--white, #e8e8e8);
}

/* Step 3: placeholder chips (dark) */
.t1-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0.5rem;
}

.t1-chips__title {
    flex-basis: 100%;
    font-size: 0.8125rem;
    color: var(--white-dim, #a0a0a0);
}

.t1-token {
    min-height: var(--tap-target-min, 44px);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--gray, #3a3a3a);
    border-radius: 999px;
    background: var(--black, #0a0a0a);
    color: var(--white, #e8e8e8);
    font-family: var(--font-mono, monospace);
    font-size: 0.875rem;
    cursor: pointer;
}

.t1-token:hover {
    border-color: var(--accent, #ff6b00);
    color: var(--accent, #ff6b00);
}

/* Live preview */
.t1-preview {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    background: var(--black-light, #111);
}

.t1-preview__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.t1-preview__title {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white-dim, #a0a0a0);
}

.t1-preview__close {
    width: 44px;
    height: 44px;
    border: 1px solid var(--gray, #3a3a3a);
    background: transparent;
    color: var(--white, #e8e8e8);
    font-size: 1.5rem;
    line-height: 1;
}

.t1-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.t1-tab {
    flex: 1 1 auto;
    min-height: var(--tap-target-min, 44px);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
    background: transparent;
    color: var(--white-dim, #a0a0a0);
    font-size: 0.8125rem;
    white-space: nowrap;
    cursor: pointer;
}

.t1-tab[aria-selected="true"] {
    border-color: var(--accent, #ff6b00);
    background: rgba(255, 107, 0, 0.12);
    color: var(--white, #e8e8e8);
}

.t1-langswitch {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-dark, #2a2a2a);
}

.t1-langswitch__btn {
    min-width: 48px;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: var(--white-dim, #a0a0a0);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.t1-langswitch__btn[aria-pressed="true"] {
    background: var(--white, #e8e8e8);
    color: #0a0a0a;
}

/* Preview in the other language than the own text: "guests in English get the standard text" */
.t1-preview__note {
    margin: -0.25rem 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--white-dim, #a0a0a0);
}

.t1-preview__frame {
    height: min(720px, calc(100vh - 260px));
    min-height: 420px;
}

.t1-preview-open {
    width: 100%;
    margin-top: 1rem;
}

/* Phone: preview is a bottom sheet (inline on step 4) */
@media (max-width: 991.98px) {
    .t1-preview {
        display: none;
    }

    .t1-preview.is-open {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1081;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        border-radius: 12px 12px 0 0;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
        overscroll-behavior: contain;
    }

    /* Tap outside the sheet closes it (a real element - a box-shadow let taps through to the page) */
    .t1-preview-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 1080;
        background: rgba(0, 0, 0, 0.6);
    }

    .t1-preview.is-open .t1-preview__frame {
        height: 64vh;
        min-height: 0;
    }

    .t1-studio[data-step="4"] .t1-preview {
        display: block;
        position: static;
        box-shadow: none;
        border-radius: 0;
        max-height: none;
    }

    .t1-studio[data-step="4"] .t1-preview__close,
    .t1-studio[data-step="4"] .t1-preview-open {
        display: none;
    }

    .t1-studio[data-step="4"] .t1-preview__frame {
        height: 70vh;
        min-height: 0;
    }

    body.t1-sheet-open {
        overflow: hidden;
    }
}

@media (min-width: 992px) {
    .t1-preview-backdrop {
        display: none !important;
    }
}
