/* ====== Mein Konto ====== */

.konto-section {
    padding: 120px 0 80px;
    min-height: 100vh;
}

/* Auth Gate */
.konto-auth-gate {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

.konto-auth-gate-inner {
    max-width: 480px;
    padding: 48px 32px;
    text-align: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.konto-auth-gate-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: var(--accent);
}

.konto-auth-gate-icon svg {
    width: 100%;
    height: 100%;
}

.konto-auth-gate-inner h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.konto-auth-gate-inner p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 24px;
}

.konto-auth-gate-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Cards */
.konto-card {
    padding: 32px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.konto-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.konto-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #15803d);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.konto-avatar svg {
    width: 28px;
    height: 28px;
}

.konto-user-info h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.konto-username {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.konto-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.konto-card-icon svg {
    width: 20px;
    height: 20px;
}

/* Locked Notice */
.konto-locked-notice {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.8);
}

.konto-locked-notice svg {
    width: 24px;
    height: 24px;
    color: #ef4444;
    flex-shrink: 0;
    margin-top: 2px;
}

.konto-locked-notice strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: #fca5a5;
}

.konto-locked-notice p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* Form */
.konto-form {
    max-width: 480px;
}

.konto-field {
    margin-bottom: 20px;
}

.konto-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.konto-field input,
.konto-field select,
.konto-field textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.konto-field textarea {
    resize: vertical;
    min-height: 54px;
}

.konto-field input:focus,
.konto-field select:focus,
.konto-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.konto-field input:disabled,
.konto-field select:disabled,
.konto-field textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.konto-field select option {
    background: #1a1f2e;
    color: #fff;
}

.konto-form-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.konto-form-row .konto-field {
    flex: 1 1 160px;
    min-width: 0;
}

.konto-card-sub {
    color: rgba(255,255,255,0.55);
    font-size: 13.5px;
    margin: -4px 0 16px 0;
    line-height: 1.55;
}

/* ==============================
   Trainer-Auswahl (Card Grid)
   ============================== */
.booking-trainer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 6px 0 8px;
}

.booking-trainer-card {
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.booking-trainer-card:hover {
    border-color: rgba(34,197,94,0.35);
    background: rgba(34,197,94,0.05);
    transform: translateY(-1px);
}

.booking-trainer-card.selected {
    border-color: #22c55e;
    background: rgba(34,197,94,0.12);
    box-shadow: 0 0 0 1px rgba(34,197,94,0.4);
}

.booking-trainer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    overflow: hidden;
}

.booking-trainer-avatar.has-image {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    text-shadow: none;
}

.booking-trainer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.booking-trainer-name {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    line-height: 1.2;
}

.booking-trainer-sub {
    font-size: 11px;
    opacity: 0.55;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

/* Konto-spezifische Overrides für geteilte Booking-Klassen (mobile-friendly) */
#konto-book-card .booking-days-scroll {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
#konto-book-card .booking-day {
    width: 68px;
}
#konto-book-card .booking-slot {
    padding: 11px 14px;
    font-size: 14px;
}

/* ==============================
   Mobile
   ============================== */
@media (max-width: 560px) {
    .konto-form-row {
        flex-direction: column;
        gap: 12px;
    }
    .konto-form-row .konto-field {
        flex-basis: auto;
    }
    .booking-trainer-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: 8px;
    }
    .booking-trainer-card {
        padding: 12px 8px 10px;
    }
    .booking-trainer-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .booking-trainer-name { font-size: 13px; }
    .booking-trainer-sub { font-size: 10px; }
    #konto-book-card .booking-day { width: 62px; padding: 10px 6px; }
    #konto-book-card .booking-slot { padding: 10px 12px; font-size: 13px; }
}

.konto-field-hint {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 6px;
    min-height: 18px;
}

.konto-field-hint.error {
    color: #f87171;
}

.konto-field-hint.success {
    color: #4ade80;
}

.konto-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.konto-form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.konto-form-actions .btn svg {
    width: 18px;
    height: 18px;
}

.konto-save-status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.konto-save-status.success {
    color: #4ade80;
}

.konto-save-status.error {
    color: #f87171;
}

/* Probetraining Info */
.konto-pt-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.konto-pt-detail {
    display: grid;
    gap: 12px;
}

.konto-pt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.konto-pt-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.konto-pt-value {
    font-size: 14px;
    font-weight: 600;
}

.konto-pt-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.konto-pt-status.offen {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.konto-pt-status.gebucht {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

.konto-pt-status.erschienen {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.konto-pt-status.nicht-erschienen {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.konto-pt-status.storniert {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.konto-pt-status.kein-termin {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

/* Eingelöst Badge */
.konto-eingeloest-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    margin-left: 8px;
}

/* Toast */
#konto-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 12px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastSlideUp 0.3s ease;
}

#konto-toast.success {
    border-color: rgba(34, 197, 94, 0.3);
}

#konto-toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    color: #fff;
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .konto-section {
        padding: 100px 16px 60px;
    }

    .konto-card {
        padding: 24px 20px;
    }

    .konto-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .konto-form {
        max-width: 100%;
    }

    .konto-auth-gate-inner {
        margin: 0 16px;
        padding: 32px 24px;
    }

    .konto-auth-gate-btns {
        flex-direction: column;
    }
}

/* ===== Klare Kontostruktur ===== */
.konto-section {
    overflow-x: hidden;
}

.konto-section > .container {
    max-width: 960px;
}

.konto-section .page-title {
    margin: 0 0 22px;
    font-size: clamp(2rem, 4vw, 2.65rem);
}

.konto-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(155deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
    box-shadow: 0 14px 36px rgba(0,0,0,.18);
}

.konto-identity-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 104px;
    padding-top: 20px;
    padding-bottom: 20px;
}

.konto-header-profile-image,
.konto-profile-image-preview {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    color: #eafff0;
    font-weight: 800;
    letter-spacing: .03em;
    background: linear-gradient(145deg, rgba(68,207,116,.95), rgba(15,113,54,.95));
    border: 1px solid rgba(255,255,255,.13);
}

.konto-header-profile-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: .95rem;
}

.konto-profile-image-preview {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    font-size: 1.35rem;
}

.konto-header-profile-image img,
.konto-profile-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.konto-identity-card .konto-user-info h2 {
    margin: 0 0 2px;
    font-size: 1.25rem;
}

.konto-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.konto-section-head h2 {
    margin: 0;
    font-size: 1.17rem;
    letter-spacing: -.015em;
}

.konto-booking-card {
    scroll-margin-top: 95px;
}

.konto-booking-card .konto-form {
    max-width: none;
}

.konto-booking-mode {
    min-width: 0;
}

.konto-booking-mode-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.konto-booking-mode-head h3 {
    margin: 0;
    font-size: .98rem;
}

.konto-free-pill {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(55,199,107,.1);
    border: 1px solid rgba(55,199,107,.22);
    color: #76dd97;
    font-size: .67rem;
    font-weight: 750;
}

.konto-booking-status,
.konto-booking-note {
    margin: 0;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.66);
    font-size: .8rem;
    line-height: 1.5;
}

#konto-book-form {
    margin: 0;
    padding: 0;
    border: 0;
}

.booking-days-scroll,
.booking-trainer-grid,
.booking-slot-grid {
    max-width: 100%;
}

.konto-appointments-card {
    padding-top: 24px;
    padding-bottom: 24px;
}

#konto-mytrainings-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#konto-mytrainings-list > .konto-pt-detail {
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    background: rgba(255,255,255,.02);
    gap: 7px;
}

#konto-mytrainings-list .konto-pt-row {
    padding: 7px 9px;
    background: transparent;
    border-color: rgba(255,255,255,.045);
}

#konto-mytrainings-list .konto-cancel-btn {
    justify-self: end;
    padding: 8px 11px;
    font-size: .72rem;
}

.konto-profile-card {
    scroll-margin-top: 95px;
}

.konto-profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: -6px;
    padding: 6px;
    list-style: none;
    cursor: pointer;
}

.konto-profile-summary::-webkit-details-marker {
    display: none;
}

.konto-profile-summary strong {
    font-size: 1.05rem;
}

.konto-details-arrow {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.55);
    transition: transform .2s;
}

.konto-profile-card[open] .konto-details-arrow {
    transform: rotate(180deg);
}

.konto-profile-content {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 26px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.konto-profile-block {
    min-width: 0;
}

.konto-profile-block + .konto-profile-block {
    padding-left: 26px;
    border-left: 1px solid rgba(255,255,255,.07);
}

.konto-profile-block h3 {
    margin: 0 0 18px;
    font-size: .95rem;
}

.konto-profile-block .konto-form {
    max-width: none;
}

.konto-profile-block .konto-locked-notice {
    margin-bottom: 16px;
}

.konto-profile-image-editor {
    display: flex;
    align-items: center;
    gap: 18px;
}

.konto-profile-image-actions {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.konto-profile-image-actions .btn {
    min-width: 118px;
    justify-content: center;
}

.konto-profile-image-actions .is-disabled {
    opacity: .5;
    pointer-events: none;
}

.konto-profile-image-actions [hidden] {
    display: none;
}

.konto-profile-image-actions small {
    color: rgba(255,255,255,.43);
    font-size: .7rem;
    line-height: 1.4;
}

@media (max-width: 800px) {
    .konto-profile-content {
        grid-template-columns: 1fr;
    }

    .konto-profile-block + .konto-profile-block {
        padding: 22px 0 0;
        border-top: 1px solid rgba(255,255,255,.07);
        border-left: 0;
    }
}

@media (max-width: 600px) {
    .konto-section {
        padding: 94px 0 56px;
    }

    .konto-section > .container {
        width: 100%;
        padding-right: 14px;
        padding-left: 14px;
    }

    .konto-section .page-title {
        margin-bottom: 16px;
        font-size: 1.85rem;
    }

    .konto-card {
        padding: 17px 15px;
        border-radius: 15px;
    }

    .konto-identity-card {
        grid-template-columns: 52px minmax(0, 1fr);
        min-height: 84px;
        gap: 12px;
    }

    .konto-header-profile-image {
        width: 52px;
        height: 52px;
    }

    .konto-identity-card .konto-user-info h2 {
        overflow: hidden;
        font-size: 1.08rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .konto-section-head {
        margin-bottom: 16px;
    }

    .konto-section-head h2 {
        font-size: 1.05rem;
    }

    #konto-mytrainings-list {
        grid-template-columns: 1fr;
    }

    .konto-pt-row {
        gap: 10px;
    }

    .konto-pt-value {
        min-width: 0;
        overflow-wrap: anywhere;
        text-align: right;
    }

    .konto-profile-summary {
        margin: -3px;
        padding: 3px;
    }

    .konto-profile-image-editor {
        align-items: flex-start;
        gap: 14px;
    }

    .konto-profile-image-preview {
        width: 86px;
        height: 86px;
    }

    .konto-profile-image-actions .btn {
        min-width: 0;
        padding: 9px 12px;
        font-size: .75rem;
    }

    .konto-form-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Footer-Aktionen: Bewertung + Abmelden (klarer Ausstieg unten im Profil) */
.konto-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 26px;
}
.konto-footer-actions .btn { min-height: 48px; }
.konto-logout-btn { color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.konto-logout-btn:hover { background: rgba(239, 68, 68, .12); }

/* Dichte-Pass Profil: kompaktere Karten, gleiche Lesbarkeit. */
.konto-card { padding: 24px; margin-bottom: 16px; }
@media (max-width: 640px) {
    .konto-card { padding: 18px 16px; }
}

/* Ranglisten-Sichtbarkeit im Profil */
.konto-ranking-intro { margin: 0 0 14px; color: var(--text-secondary, rgba(255, 255, 255, .65)); font-size: .92rem; line-height: 1.45; }
.konto-ranking-options { display: flex; flex-direction: column; gap: 10px; }
.konto-ranking-option {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 13px 15px; border-radius: 13px; min-height: 44px;
    background: rgba(255, 255, 255, .04); border: 1.5px solid rgba(255, 255, 255, .1);
    color: inherit; font-family: inherit; transition: border-color .15s, background .15s;
}
.konto-ranking-option:hover { background: rgba(255, 255, 255, .06); }
.konto-ranking-option strong { display: block; font-size: 1rem; color: #fff; margin-bottom: 3px; }
.konto-ranking-option span { display: block; font-size: .84rem; color: var(--text-secondary, rgba(255, 255, 255, .6)); line-height: 1.4; }
.konto-ranking-option.active { border-color: var(--accent-light, #22c55e); background: rgba(34, 197, 94, .12); }
.konto-ranking-option:disabled { opacity: .6; cursor: default; }
.konto-ranking-status { margin-top: 10px; min-height: 1em; }
