/* ==========================================================================
   DiodeMatrix Account Portal
   Layered on top of the existing Copler theme stylesheets. The theme supplies
   the page background, header, footer and Inter typeface; everything below
   styles the account panels only.

   All colours live in the token block. Retune here, not further down.
   ========================================================================== */

:root {
    --acc-panel: rgba(255, 255, 255, 0.035);
    --acc-panel-raised: rgba(255, 255, 255, 0.06);
    --acc-line: rgba(255, 255, 255, 0.10);
    --acc-line-strong: rgba(255, 255, 255, 0.18);

    --acc-text: #e9edf6;
    --acc-muted: #98a3bd;
    --acc-faint: #6f7b96;

    --acc-accent: #5b8cff;
    --acc-accent-soft: rgba(91, 140, 255, 0.14);
    --acc-accent-line: rgba(91, 140, 255, 0.45);

    --acc-good: #43c88b;
    --acc-good-soft: rgba(67, 200, 139, 0.12);
    --acc-warn: #e8b054;
    --acc-warn-soft: rgba(232, 176, 84, 0.12);
    --acc-bad: #ef6b6b;
    --acc-bad-soft: rgba(239, 107, 107, 0.12);

    --acc-radius: 14px;
    --acc-radius-sm: 9px;
    --acc-gap: 24px;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.acc-wrap {
    max-width: 1180px;
    margin: 0 auto;
    /* Top padding was sized to clear the site header, which no longer exists. */
    padding: 56px 20px 40px;
    color: var(--acc-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Fill the viewport so short pages (the sign-in screen above all) push the
       footer to the bottom instead of leaving dead space beneath it. */
    box-sizing: border-box;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Dynamic viewport height where supported, so mobile browser chrome
   appearing and disappearing doesn't cause a jump. */
@supports (min-height: 100dvh) {
    .acc-wrap {
        min-height: 100dvh;
    }
}

/* Anything before the footer takes the slack. */
.acc-footer {
    margin-top: auto;
}

/* Neutralise any padding or margin the theme puts on the wrappers around
   .acc-wrap. Left in place, it would stack on top of the 100vh above and
   reintroduce exactly the trailing whitespace this is meant to remove. */
.acc-body,
.acc-body #page,
.acc-body .site-content {
    margin: 0;
    padding: 0;
}

.acc-head {
    margin-bottom: 40px;
}

.acc-head h1 {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: var(--acc-text);
    line-height: 1.15;
}

.acc-head p {
    margin: 0;
    color: var(--acc-muted);
    font-size: 1.02rem;
    max-width: 62ch;
    line-height: 1.6;
}

.acc-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}

/* --------------------------------------------------------------------------
   Sidebar navigation
   -------------------------------------------------------------------------- */

.acc-nav {
    position: sticky;
    top: 32px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.acc-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: var(--acc-radius-sm);
    color: var(--acc-muted);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: color .15s ease, background-color .15s ease;
}

.acc-nav a:hover {
    color: var(--acc-text);
    background: var(--acc-panel);
}

.acc-nav a.is-active {
    color: var(--acc-text);
    background: var(--acc-accent-soft);
    border-color: var(--acc-accent-line);
}

.acc-nav a i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    opacity: .85;
}

.acc-nav-sep {
    height: 1px;
    background: var(--acc-line);
    margin: 14px 14px;
}

.acc-nav a.is-danger:hover {
    color: var(--acc-bad);
}

/* Sign out is a POST form, so it needs to look identical to a nav link. */
.acc-nav-form {
    margin: 0;
}

.acc-nav-signout {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--acc-radius-sm);
    border: 1px solid transparent;
    background: none;
    color: var(--acc-muted);
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}

.acc-nav-signout:hover {
    color: var(--acc-bad);
    background: var(--acc-panel);
}

.acc-nav-signout i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    opacity: .85;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.acc-card {
    background: var(--acc-panel);
    border: 1px solid var(--acc-line);
    border-radius: var(--acc-radius);
    padding: 26px 28px;
    margin-bottom: var(--acc-gap);
}

.acc-card > h2 {
    font-size: 1.12rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    color: var(--acc-text);
}

.acc-card > .acc-sub {
    margin: 0 0 22px;
    color: var(--acc-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 66ch;
}

.acc-card > .acc-sub:last-child {
    margin-bottom: 0;
}

.acc-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.acc-card-head h2 {
    margin: 0 0 6px;
    font-size: 1.12rem;
    font-weight: 650;
    color: var(--acc-text);
}

.acc-card-head p {
    margin: 0;
    color: var(--acc-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 62ch;
}

/* --------------------------------------------------------------------------
   Identity summary
   -------------------------------------------------------------------------- */

.acc-identity {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.acc-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--acc-line-strong);
    background: var(--acc-panel-raised);
    flex: 0 0 auto;
}

.acc-avatar-fallback {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 650;
    color: var(--acc-accent);
    background: var(--acc-accent-soft);
    border: 1px solid var(--acc-accent-line);
    flex: 0 0 auto;
}

.acc-identity-text strong {
    display: block;
    font-size: 1.18rem;
    font-weight: 650;
    color: var(--acc-text);
    line-height: 1.3;
}

.acc-identity-text span {
    color: var(--acc-muted);
    font-size: 0.94rem;
}

/* --------------------------------------------------------------------------
   Definition rows
   -------------------------------------------------------------------------- */

.acc-rows {
    display: grid;
    gap: 0;
}

.acc-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--acc-line);
    align-items: baseline;
}

.acc-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.acc-row:first-child {
    padding-top: 0;
}

.acc-row dt {
    color: var(--acc-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.acc-row dd {
    margin: 0;
    color: var(--acc-text);
    font-size: 0.95rem;
    word-break: break-word;
}

/* --------------------------------------------------------------------------
   Item lists (sessions, devices, tokens, apps)
   -------------------------------------------------------------------------- */

.acc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--acc-line);
}

.acc-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--acc-line);
}

.acc-item-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--acc-panel-raised);
    border: 1px solid var(--acc-line);
    color: var(--acc-muted);
    font-size: 0.95rem;
}

.acc-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.acc-item-title {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 0.97rem;
    font-weight: 550;
    color: var(--acc-text);
    line-height: 1.4;
}

.acc-item-meta {
    margin-top: 3px;
    color: var(--acc-muted);
    font-size: 0.85rem;
    line-height: 1.55;
}

.acc-item-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.acc-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid var(--acc-line-strong);
    color: var(--acc-muted);
    background: var(--acc-panel-raised);
    white-space: nowrap;
}

.acc-badge.is-current {
    color: var(--acc-good);
    background: var(--acc-good-soft);
    border-color: rgba(67, 200, 139, 0.4);
}

.acc-badge.is-warn {
    color: var(--acc-warn);
    background: var(--acc-warn-soft);
    border-color: rgba(232, 176, 84, 0.4);
}

.acc-badge.is-accent {
    color: var(--acc-accent);
    background: var(--acc-accent-soft);
    border-color: var(--acc-accent-line);
}

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

.acc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--acc-radius-sm);
    border: 1px solid var(--acc-accent);
    background: var(--acc-accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease, border-color .15s ease;
}

.acc-btn:hover {
    filter: brightness(1.1);
    color: #fff;
}

.acc-btn.is-quiet {
    background: transparent;
    border-color: var(--acc-line-strong);
    color: var(--acc-text);
}

.acc-btn.is-quiet:hover {
    background: var(--acc-panel-raised);
    border-color: var(--acc-text);
    filter: none;
}

.acc-btn.is-danger {
    background: transparent;
    border-color: rgba(239, 107, 107, 0.45);
    color: var(--acc-bad);
}

.acc-btn.is-danger:hover {
    background: var(--acc-bad-soft);
    border-color: var(--acc-bad);
    color: var(--acc-bad);
    filter: none;
}

.acc-btn.is-small {
    padding: 7px 14px;
    font-size: 0.85rem;
}

.acc-btn[disabled],
.acc-btn.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.acc-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.acc-field {
    margin-bottom: 20px;
    max-width: 460px;
}

.acc-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.89rem;
    font-weight: 550;
    color: var(--acc-text);
}

.acc-field input[type="text"],
.acc-field input[type="email"],
.acc-field input[type="password"],
.acc-field input[type="date"],
.acc-field select,
.acc-field textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--acc-radius-sm);
    border: 1px solid var(--acc-line-strong);
    background: rgba(0, 0, 0, 0.22);
    color: var(--acc-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.acc-field input:focus,
.acc-field select:focus,
.acc-field textarea:focus {
    outline: none;
    border-color: var(--acc-accent);
    box-shadow: 0 0 0 3px var(--acc-accent-soft);
}

.acc-field input[readonly] {
    opacity: .6;
    cursor: not-allowed;
}

.acc-field .acc-hint {
    margin-top: 7px;
    font-size: 0.84rem;
    color: var(--acc-faint);
    line-height: 1.55;
}

/* Visible keyboard focus everywhere, not just inputs. */
.acc-wrap a:focus-visible,
.acc-wrap button:focus-visible,
.acc-wrap input:focus-visible,
.acc-wrap select:focus-visible {
    outline: 2px solid var(--acc-accent);
    outline-offset: 2px;
}

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

.acc-notice {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    padding: 14px 18px;
    border-radius: var(--acc-radius-sm);
    border: 1px solid var(--acc-line-strong);
    background: var(--acc-panel-raised);
    color: var(--acc-text);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

.acc-notice i {
    margin-top: 3px;
    flex: 0 0 auto;
}

.acc-notice.is-success {
    border-color: rgba(67, 200, 139, 0.45);
    background: var(--acc-good-soft);
}

.acc-notice.is-success i {
    color: var(--acc-good);
}

.acc-notice.is-error {
    border-color: rgba(239, 107, 107, 0.45);
    background: var(--acc-bad-soft);
}

.acc-notice.is-error i {
    color: var(--acc-bad);
}

.acc-notice.is-info i {
    color: var(--acc-accent);
}

.acc-notice.is-warn {
    border-color: rgba(232, 176, 84, 0.45);
    background: var(--acc-warn-soft);
}

.acc-notice.is-warn i {
    color: var(--acc-warn);
}

/* Revealed secret (token / app password) */
.acc-secret {
    display: block;
    margin-top: 10px;
    padding: 13px 16px;
    border-radius: var(--acc-radius-sm);
    border: 1px dashed var(--acc-accent-line);
    background: rgba(0, 0, 0, 0.3);
    color: var(--acc-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */

.acc-empty {
    padding: 34px 20px;
    text-align: center;
    color: var(--acc-muted);
    border: 1px dashed var(--acc-line-strong);
    border-radius: var(--acc-radius-sm);
    font-size: 0.93rem;
    line-height: 1.6;
}

.acc-empty strong {
    display: block;
    color: var(--acc-text);
    font-weight: 600;
    margin-bottom: 5px;
}

/* --------------------------------------------------------------------------
   Sign-in screen
   -------------------------------------------------------------------------- */

.acc-signin {
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    text-align: center;

    /* Take the free vertical space and centre within it. */
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.acc-signin .acc-card {
    padding: 40px 34px;
}

.acc-signin h1 {
    font-size: 1.7rem;
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.acc-signin p {
    color: var(--acc-muted);
    margin: 0 0 26px;
    line-height: 1.65;
    font-size: 0.97rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .acc-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 26px;
    }

    .acc-nav {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 8px;
        scrollbar-width: thin;
    }

    .acc-nav a {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .acc-nav-sep {
        display: none;
    }

    .acc-nav-form {
        flex: 0 0 auto;
    }

    .acc-nav-signout {
        white-space: nowrap;
        width: auto;
    }

    .acc-wrap {
        padding: 36px 16px 32px;
    }

    .acc-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 4px;
    }
}

@media (max-width: 620px) {
    .acc-card {
        padding: 22px 18px;
    }

    .acc-item {
        flex-wrap: wrap;
    }

    .acc-item-actions {
        width: 100%;
        padding-left: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .acc-wrap * {
        transition: none !important;
        animation: none !important;
    }
}

/* --------------------------------------------------------------------------
   Utilities
   These exist so templates need no inline style attributes, which lets the
   Content-Security-Policy stay strict.
   -------------------------------------------------------------------------- */

.acc-spaced {
    margin-top: 22px;
}

.acc-optional {
    font-weight: 400;
    opacity: .6;
}

/* Footer logo previously carried style="width:100%". */
.fbth-site-logo img.is-full {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Footer

   The site footer is gone; this single line replaces it, matching the muted
   treatment the old legal line used.
   -------------------------------------------------------------------------- */

.acc-footer {
    padding-top: 26px;
    border-top: 1px solid var(--acc-line);
    text-align: center;
}

.acc-footer p {
    margin: 0 0 4px;
    color: var(--acc-faint);
    font-size: 0.86rem;
    line-height: 1.6;
}

.acc-footer p:last-child {
    margin-bottom: 0;
}

.acc-footer a {
    color: var(--acc-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--acc-line-strong);
    padding-bottom: 1px;
    transition: color .15s ease, border-color .15s ease;
}

.acc-footer a:hover {
    color: var(--acc-text);
    border-color: var(--acc-text);
}

/* Background fallback.
   The theme stylesheets still set the body background, so this normally never
   shows. It sits on <html> rather than <body> so the theme's own rule always
   wins, and only prevents a white page if a CDN stylesheet fails to load. */
html {
    background-color: var(--acc-bg);
}

:root {
    --acc-bg: #0d1424;
}
