/*
 * Kundenportal.
 *
 * Nutzt die Design-Tokens des gts-Themes (--gts-*). Fallbacks stehen überall
 * dabei, damit das Portal auch im Backend-Vorschaukontext oder unter einem
 * anderen Theme lesbar bleibt.
 */

.angercode-portal
{
    --portal-border  : var(--gts-accent-color-1, #222329);
    --portal-accent  : var(--gts-default-ci-color, #cd0000);
    --portal-ink     : var(--gts-accent-color-1, #222329);
    --portal-muted   : #4d566a;

    /*
     * Grundfläche ist der Seitenhintergrund des Inhaltsbereichs, nicht Weiß.
     * Die Zeilentöne liegen eine Spur heller und dunkler darüber - dadurch
     * wirken Tabellen ruhig statt wie grell weiße Kästen.
     * Die Hex-Werte davor sind der Fallback für Browser ohne color-mix.
     */
    --portal-surface : var(--gts-default-background-accent, #abb7ce);

    --portal-row-a   : #bcc6d9;
    --portal-row-a   : color-mix(in srgb, var(--portal-surface) 78%, #ffffff);

    --portal-row-b   : #9ca8be;
    --portal-row-b   : color-mix(in srgb, var(--portal-surface) 88%, #111218);

    --portal-soft    : #b4bfd4;
    --portal-soft    : color-mix(in srgb, var(--portal-surface) 88%, #ffffff);

    color            : var(--portal-ink);
}

/*
 * Breite wie die Seitenüberschrift.
 *
 * Twenty Twenty-One presst Inhalte mit
 *   .entry-content > :not(.alignwide):not(.alignfull):not(...)
 * auf --responsive--aligndefault-width (610px). Fünf :not() ergeben
 * Spezifität 0,6,0, und style.css wird vom Theme zweimal eingebunden - die
 * zweite Instanz liegt hinter diesem Stylesheet. Dagegen anzuschreiben
 * führt zu einem Spezifitätswettlauf.
 *
 * Stattdessen tragen die Portal-Wurzeln die Klasse .alignwide: damit nimmt
 * das Theme sie per :not() selbst von der Begrenzung aus. Bleibt nur noch
 * dessen .alignwide-Regel, die der Selektor unten mit 0,3,0 übertrifft.
 *
 * Gesetzt wird dann dieselbe Breite, die content.css den Textblöcken gibt
 * (--gts-max-content-width, zentriert) - das Portal schließt damit links und
 * rechts mit h1.entry-title ab, genau wie der Inhalt der übrigen Seiten.
 */
.angercode-portal,
.entry-content > .angercode-portal,
.entry-content > .angercode-portal.alignwide,
.entry-content > .wp-block-shortcode .angercode-portal
{
    width        : 100%;
    max-width    : 1200px;
    max-width    : var(--gts-max-content-width, 1200px);
    margin-left  : auto;
    margin-right : auto;
}

.angercode-portal a
{
    color : var(--gts-accent-color-2, #1d2557);
}

.angercode-portal a:hover
{
    color : var(--portal-accent);
}

/* Kopf ------------------------------------------------------------------ */

.angercode-portal__header
{
    display         : flex;
    flex-wrap       : wrap;
    gap             : 20px;
    align-items     : flex-start;
    justify-content : space-between;
    padding-bottom  : 20px;
    border-bottom   : 3px solid var(--portal-border);
}

.angercode-portal__eyebrow
{
    margin         : 0;
    font-weight    : bold;
    text-transform : uppercase;
    letter-spacing : 0.08em;
    font-size      : 0.9rem;
    color          : var(--portal-muted);
}

.angercode-portal__company
{
    margin : 0;
}

.angercode-portal__user
{
    text-align : right;
    font-size  : 0.95rem;
}

.angercode-portal__user p
{
    margin : 0 0 4px;
}

/* Navigation ------------------------------------------------------------ */

.angercode-portal__nav ul
{
    display    : flex;
    flex-wrap  : wrap;
    gap        : 4px;
    margin     : 0 0 24px;
    padding    : 0;
    list-style : none;
}

.angercode-portal__nav a
{
    display         : block;
    padding         : 10px 18px;
    text-decoration : none;
    font-weight     : bold;
    background      : var(--gts-default-background-color, #c9d5ed);
    border-bottom   : 3px solid transparent;
    transition      : var(--default-transition, all 300ms ease);
}

.angercode-portal__nav a:hover
{
    background : var(--portal-row-a);
}

.angercode-portal__nav a.is-active
{
    background   : var(--portal-soft);
    border-color : var(--portal-accent);
}

/* Blöcke ---------------------------------------------------------------- */

.angercode-portal__block
{
    margin        : 0 0 28px;
    padding       : 0 0 22px;
    background    : transparent;
    border-bottom : 1px solid rgba(17, 18, 24, 0.14);
}

.angercode-portal__block:last-child
{
    border-bottom : 0;
}

.angercode-portal__block h3
{
    margin-top : 0;
}

.angercode-portal__columns
{
    display               : grid;
    grid-template-columns : repeat(auto-fit, minmax(300px, 1fr));
    gap                   : 20px;
}

/* Listen ---------------------------------------------------------------- */

.angercode-portal__list
{
    margin     : 0 0 12px;
    padding    : 0;
    list-style : none;
}

.angercode-portal__list > li
{
    padding       : 10px 2px;
    border-bottom : 1px solid rgba(17, 18, 24, 0.12);
}

.angercode-portal__list > li:last-child
{
    border-bottom : 0;
}

.angercode-portal__meta
{
    display    : block;
    font-size  : 0.88rem;
    color      : var(--portal-muted);
}

.angercode-portal__empty
{
    margin : 0;
    color  : var(--portal-muted);
}

/* Tabellen -------------------------------------------------------------- */

.angercode-portal__table
{
    width           : 100%;
    border-collapse : collapse;
    background      : transparent;
}

.angercode-portal__table th,
.angercode-portal__table td
{
    padding        : 11px 14px;
    text-align     : left;
    vertical-align : top;
    border         : 0;
}

.angercode-portal__table thead th
{
    font-size      : 0.82rem;
    text-transform : uppercase;
    letter-spacing : 0.04em;
    color          : var(--portal-ink);
    background     : transparent;
    border-bottom  : 2px solid var(--portal-border);
}

/* Zeilenwechsel: eine Spur heller und eine Spur dunkler als die Fläche. */
.angercode-portal__table tbody tr:nth-child(odd)
{
    background : var(--portal-row-a);
}

.angercode-portal__table tbody tr:nth-child(even)
{
    background : var(--portal-row-b);
}

.angercode-portal__cell-action
{
    text-align : right;
    white-space : nowrap;
}

/* Status und Abzeichen -------------------------------------------------- */

.angercode-portal__badge
{
    display        : inline-block;
    padding        : 3px 10px;
    font-size      : 0.82rem;
    font-weight    : bold;
    background     : var(--gts-default-background-color, #c9d5ed);
    white-space    : nowrap;
}

.angercode-portal__badge.is-faellig,
.angercode-portal__list--status li.is-faellig .angercode-portal__badge
{
    background : var(--portal-accent);
    color      : #fff;
}

.angercode-portal__badge.is-bald,
.angercode-portal__list--status li.is-bald .angercode-portal__badge
{
    background : #f0b429;
    color      : #3a2c00;
}

.angercode-portal__badge.is-ok
{
    background : #c6e6cd;
    color      : #16351d;
}

.angercode-portal__status
{
    padding      : 10px 14px;
    border-left  : 5px solid var(--portal-border);
    background   : var(--portal-soft);
}

.angercode-portal__status.is-faellig
{
    border-color : var(--portal-accent);
}

.angercode-portal__status.is-bald
{
    border-color : #f0b429;
}

/*
 * Status direkt neben dem Anlagennamen statt am äußersten Rand: über die
 * volle Inhaltsbreite würde space-between beide Enden auseinanderreißen.
 */
.angercode-portal__list--status li
{
    display               : grid;
    grid-template-columns : minmax(0, 26rem) auto;
    gap                   : 16px;
    align-items           : baseline;
    justify-content       : start;
}

/* Definitionslisten ----------------------------------------------------- */

.angercode-portal__data
{
    display               : grid;
    grid-template-columns : minmax(160px, auto) 1fr;
    gap                   : 8px 20px;
    margin                : 0 0 16px;
}

.angercode-portal__data dt
{
    font-weight : bold;
    color       : var(--portal-muted);
}

.angercode-portal__data dd
{
    margin : 0;
}

/* Formulare ------------------------------------------------------------- */

.angercode-portal__login-grid
{
    display               : grid;
    grid-template-columns : repeat(auto-fit, minmax(300px, 1fr));
    gap                   : 30px;
    align-items           : start;
}

.angercode-portal__form
{
    padding    : 24px;
    background : var(--portal-soft);
}

.angercode-portal__form p
{
    margin : 0 0 16px;
}

.angercode-portal__form label
{
    display     : block;
    margin      : 0 0 4px;
    font-weight : bold;
}

.angercode-portal__form input[type='text'],
.angercode-portal__form input[type='email'],
.angercode-portal__form input[type='tel'],
.angercode-portal__form input[type='password'],
.angercode-portal__form input[type='date']
{
    width         : 100%;
    padding       : 10px;
    border        : 0;
    border-bottom : 1px solid var(--portal-border);
    background    : var(--gts-input-background-color, #1d255722);
}

.angercode-portal__form input[readonly]
{
    color  : var(--portal-muted);
    cursor : not-allowed;
}

.angercode-portal__form--wide
{
    display               : grid;
    grid-template-columns : repeat(auto-fit, minmax(260px, 1fr));
    gap                   : 0 24px;
}

.angercode-portal__form--wide > p:last-of-type
{
    grid-column : 1 / -1;
}

.angercode-portal__checkbox label
{
    font-weight : normal;
}

.angercode-portal__hint
{
    display   : block;
    margin    : 4px 0 0;
    font-size : 0.82rem;
    color     : var(--portal-muted);
}

.angercode-portal__button
{
    display         : inline-block;
    padding         : 12px 24px;
    border          : 0;
    font-family     : inherit;
    font-size       : 1rem;
    font-weight     : bold;
    text-decoration : none;
    cursor          : pointer;
    color           : var(--gts-default-light-color, #fefefe);
    background      : var(--portal-border);
    transition      : var(--default-transition, all 300ms ease);
}

.angercode-portal__button:hover
{
    color      : var(--gts-default-light-color, #fefefe);
    background : var(--portal-accent);
}

.angercode-portal__button--small
{
    padding   : 7px 14px;
    font-size : 0.85rem;
}

.angercode-portal__aside h2
{
    margin-top : 0;
}

/* Meldungen ------------------------------------------------------------- */

.angercode-portal__notice,
.angercode-portal__error
{
    padding      : 14px 18px;
    margin       : 0 0 20px;
    border-left  : 5px solid var(--gts-accent-color-2, #1d2557);
    background   : var(--portal-soft);
}

.angercode-portal__error
{
    border-color : var(--portal-accent);
    font-weight  : bold;
}

.angercode-portal__filter
{
    display   : flex;
    flex-wrap : wrap;
    gap       : 8px;
    margin    : 0 0 18px;
}

.angercode-portal__filter a
{
    padding         : 6px 14px;
    font-size       : 0.88rem;
    text-decoration : none;
    background      : var(--gts-default-background-color, #c9d5ed);
}

.angercode-portal__filter a.is-active
{
    color      : #fff;
    background : var(--portal-border);
}

.angercode-portal__back
{
    margin : 0 0 16px;
}

.angercode-portal__text
{
    font-size : 0.95rem;
}

/* Preis gesperrt im Shop ------------------------------------------------ */

.angercode-price-locked a
{
    font-weight     : bold;
    text-decoration : underline;
}

.angercode-login-notice
{
    margin : 10px 0 0;
}

@media (max-width : 700px)
{
    .angercode-portal__header
    {
        flex-direction : column;
    }

    .angercode-portal__user
    {
        text-align : left;
    }

    .angercode-portal__table thead
    {
        display : none;
    }

    .angercode-portal__table tr
    {
        display       : block;
        padding       : 10px 14px;
        border-bottom : 2px solid var(--portal-border);
    }

    .angercode-portal__table td
    {
        display     : block;
        border      : 0;
        padding     : 4px 0;
        text-align  : left;
    }

    .angercode-portal__cell-action
    {
        text-align : left;
    }
}
