/* ==========================================================================
   FC Profile Component
   ========================================================================== */

@layer components {
    .fc-profile,
    .fc-profile__dialog {
        --fc-profile-bg: #080908;
        --fc-profile-card: #111410;
        --fc-profile-card-alt: #121512;
        --fc-profile-field: #0b0d0b;
        --fc-profile-green: #aaff00;
        --fc-profile-red: #ff2d55;
        --fc-profile-text: rgba(255, 255, 255, 0.88);
        --fc-profile-heading: rgba(255, 255, 255, 0.94);
        --fc-profile-muted: rgba(255, 255, 255, 0.64);
        --fc-profile-faint: rgba(255, 255, 255, 0.42);
        --fc-profile-border: rgba(255, 255, 255, 0.08);
        --fc-profile-green-border: rgba(170, 255, 0, 0.22);
    }

    .fc-profile {
        background: #111410;
        min-block-size: calc(100vh - 160px);
        margin-block-end: 72px;
    }

    .fc-profile.center-content {
        --content-max-width: 77.5rem;
        --inner-max-width: 77.5rem;
        --breakout-max-width: 77.5rem;
    }

    .fc-profile--denied {
        display: grid;
        place-content: center;
        min-block-size: 50vh;
        padding-block: 64px;
        color: var(--fc-profile-text);
        text-align: center;
    }

    .fc-profile--denied a {
        color: var(--fc-profile-green);
        font-weight: 800;
    }

    .fc-profile__layout {
        display: grid;
        grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
        gap: 32px;
        align-items: start;
        padding-block: 56px 32px;
    }

    .fc-profile__sidebar {
        position: sticky;
        top: 112px;
        display: grid;
        gap: 12px;
        align-self: start;
        padding: 24px;
        text-align: center;
        background: #292929;
        border: 1px solid var(--fc-profile-green-border);
        border-radius: 12px;
        box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
    }

    .fc-profile__avatar {
        display: grid;
        place-content: center;
        inline-size: 56px;
        block-size: 56px;
        margin-inline: auto;
        border-radius: 50%;
        background: radial-gradient(circle at 35% 30%, #d8ff77, var(--fc-profile-green));
        box-shadow: 0 0 0 6px rgba(170, 255, 0, 0.08);
    }

    .fc-profile__avatar-initials {
        color: #111410;
        font-size: 19px;
        font-weight: 900;
        line-height: 1;
        text-transform: uppercase;
        user-select: none;
    }

    .fc-profile__sidebar-name {
        margin: 4px 0 0;
        color: var(--fc-profile-heading);
        font-size: 17px;
        font-weight: 800;
        line-height: 1.25;
    }

    .fc-profile__sidebar-username {
        margin: 0;
        color: var(--fc-profile-muted);
        font-size: 13px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .fc-profile__tier-badge,
    .fc-profile__plan-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        justify-self: center;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1;
        padding: 7px 12px;
        text-transform: uppercase;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: var(--fc-profile-muted);
    }

    .fc-profile__tier-badge--pro,
    .fc-profile__plan-label--pro {
        color: var(--fc-profile-green);
        background: rgba(170, 255, 0, 0.12);
        border-color: rgba(170, 255, 0, 0.42);
    }

    .fc-profile__tier-badge--free,
    .fc-profile__plan-label--free {
        color: rgba(255, 255, 255, 0.76);
        background: rgba(255, 255, 255, 0.07);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .fc-profile__nav-list {
        display: grid;
        gap: 4px;
        margin: 14px 0 0;
        padding: 16px 10px 0;
        list-style: none;
        text-align: left;
        border-block-start: 1px solid rgba(255, 255, 255, 0.08);
    }

    .fc-profile__nav-link {
        position: relative;
        display: flex;
        align-items: center;
        min-block-size: 40px;
        padding: 10px 12px 10px 16px;
        border-radius: 999px;
        color: rgba(255, 255, 255, 0.68);
        font-size: 14px;
        font-weight: 700;
        line-height: 1.2;
        text-decoration: none;
        transition: background-color var(--transition-time, 180ms) ease-in-out,
            color var(--transition-time, 180ms) ease-in-out;
    }

    .fc-profile__nav-link::before {
        content: "";
        position: absolute;
        inset-block: 12px;
        inset-inline-start: 7px;
        inline-size: 3px;
        border-radius: 999px;
        background: transparent;
    }

    .fc-profile__nav-link:hover,
    .fc-profile__nav-link:focus-visible {
        color: var(--fc-profile-heading);
        background: rgba(255, 255, 255, 0.06);
        outline: none;
    }

    .fc-profile__nav-link.is-active {
        color: var(--fc-profile-green);
        background: rgba(170, 255, 0, 0.1);
    }

    .fc-profile__nav-link.is-active::before {
        background: var(--fc-profile-green);
    }

    .fc-profile__main {
        display: grid;
        gap: 28px;
        min-inline-size: 0;
    }

    .fc-profile__card {
        scroll-margin-top: 112px;
        display: grid;
        gap: 22px;
        padding: 26px 28px 28px;
        color: var(--fc-profile-text);
        background: linear-gradient(180deg, var(--fc-profile-card-alt), var(--fc-profile-card));
        border: 1px solid var(--fc-profile-border);
        border-radius: 12px;
        box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    }

    .fc-profile__card-header {
        display: grid;
        gap: 6px;
        padding-block-end: 18px;
        border-block-end: 1px solid rgba(255, 255, 255, 0.08);
    }

    .fc-profile__card-title {
        margin: 0;
        color: var(--fc-profile-heading);
        font-size: 22px;
        font-weight: 800;
        line-height: 1.2;
    }

    .fc-profile__card-desc {
        margin: 0;
        color: var(--fc-profile-muted);
        font-size: 15px;
        line-height: 1.55;
    }

    .fc-profile__alert {
        padding: 12px 14px;
        border-radius: 8px;
        font-size: 14px;
        line-height: 1.45;
    }

    .fc-profile__alert[hidden] {
        display: none;
    }

    .fc-profile__alert[data-type="error"] {
        color: #ff8aa2;
        background: rgba(255, 45, 85, 0.1);
        border: 1px solid rgba(255, 45, 85, 0.32);
    }

    .fc-profile__alert[data-type="success"] {
        color: var(--fc-profile-green);
        background: rgba(170, 255, 0, 0.1);
        border: 1px solid rgba(170, 255, 0, 0.34);
    }

    .fc-profile__form {
        display: grid;
        gap: 18px;
    }

    .fc-profile__form--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
        row-gap: 18px;
    }

    .fc-profile__field {
        display: grid;
        gap: 8px;
        min-inline-size: 0;
    }

    .fc-profile__field label {
        color: rgba(255, 255, 255, 0.66);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1.25;
        text-transform: uppercase;
    }

    .fc-profile__field input {
        box-sizing: border-box;
        inline-size: 100%;
        min-block-size: 44px;
        padding: 10px 12px;
        color: rgba(255, 255, 255, 0.9);
        background: var(--fc-profile-field);
        border: 1px solid rgba(255, 255, 255, 0.13);
        border-radius: 8px;
        font: inherit;
        font-size: 15px;
        outline: none;
        transition: border-color var(--transition-time, 180ms) ease-in-out,
            box-shadow var(--transition-time, 180ms) ease-in-out,
            background-color var(--transition-time, 180ms) ease-in-out;
    }

    .fc-profile__field input::placeholder {
        color: rgba(255, 255, 255, 0.35);
    }

    .fc-profile__field input:focus {
        border-color: var(--fc-profile-green);
        box-shadow: 0 0 0 3px rgba(170, 255, 0, 0.16);
    }

    .fc-profile__field input:read-only,
    .fc-profile__field input:disabled {
        color: rgba(255, 255, 255, 0.62);
        background: rgba(255, 255, 255, 0.04);
        cursor: not-allowed;
    }

    .fc-profile__field--span2 {
        grid-column: 1 / -1;
    }

    .fc-profile__field-hint {
        color: var(--fc-profile-faint);
        font-size: 13px;
        line-height: 1.45;
    }

    .fc-profile__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        padding-block-start: 4px;
    }

    .fc-profile .button,
    .fc-profile__dialog .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-block-size: 42px;
        padding: 10px 18px;
        border-radius: 999px;
        border: 1px solid transparent;
        font-size: 15px;
        font-weight: 800;
        line-height: 1;
        text-decoration: none;
        text-transform: none;
        text-wrap: nowrap;
        transition: background-color var(--transition-time, 180ms) ease-in-out,
            border-color var(--transition-time, 180ms) ease-in-out,
            color var(--transition-time, 180ms) ease-in-out,
            opacity var(--transition-time, 180ms) ease-in-out;
    }

    .fc-profile .button-primary,
    .fc-profile__dialog .button-primary {
        color: #111410;
        background: var(--fc-profile-green);
        border-color: var(--fc-profile-green);
    }

    .fc-profile .button-primary:hover,
    .fc-profile .button-primary:focus-visible,
    .fc-profile__dialog .button-primary:hover,
    .fc-profile__dialog .button-primary:focus-visible {
        color: var(--fc-profile-green);
        background: #050605;
        outline: none;
    }

    .fc-profile .button-secondary,
    .fc-profile .button-upgrade,
    .fc-profile__dialog .button-secondary {
        color: var(--fc-profile-green);
        background: rgba(170, 255, 0, 0.04);
        border-color: rgba(170, 255, 0, 0.55);
    }

    .fc-profile .button-secondary:hover,
    .fc-profile .button-secondary:focus-visible,
    .fc-profile .button-upgrade:hover,
    .fc-profile .button-upgrade:focus-visible,
    .fc-profile__dialog .button-secondary:hover,
    .fc-profile__dialog .button-secondary:focus-visible {
        color: #111410;
        background: var(--fc-profile-green);
        border-color: var(--fc-profile-green);
        outline: none;
    }

    .fc-profile .button-danger,
    .fc-profile__dialog .button-danger {
        color: var(--fc-profile-red);
        background: rgba(255, 45, 85, 0.06);
        border-color: rgba(255, 45, 85, 0.7);
    }

    .fc-profile .button-danger:hover,
    .fc-profile .button-danger:focus-visible,
    .fc-profile__dialog .button-danger:hover,
    .fc-profile__dialog .button-danger:focus-visible {
        color: #ffffff;
        background: rgba(255, 45, 85, 0.9);
        border-color: rgba(255, 45, 85, 0.95);
        outline: none;
    }

    .fc-profile .button:disabled,
    .fc-profile__dialog .button:disabled {
        opacity: 0.45;
        cursor: not-allowed;
        pointer-events: none;
    }

    .fc-profile__lang-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
        gap: 14px;
    }

    .fc-profile__lang-option {
        position: relative;
        display: grid;
        justify-items: center;
        gap: 10px;
        min-block-size: 150px;
        padding: 20px 16px;
        color: var(--fc-profile-text);
        background: rgba(8, 9, 8, 0.74);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        cursor: pointer;
        transition: border-color var(--transition-time, 180ms) ease-in-out,
            background-color var(--transition-time, 180ms) ease-in-out,
            opacity var(--transition-time, 180ms) ease-in-out;
    }

    .fc-profile__lang-option input[type="radio"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .fc-profile__lang-option:hover:not(.fc-profile__lang-option--soon) {
        border-color: rgba(170, 255, 0, 0.48);
        background: rgba(170, 255, 0, 0.06);
    }

    .fc-profile__lang-option.is-selected {
        border-color: var(--fc-profile-green);
        box-shadow: inset 0 0 0 1px rgba(170, 255, 0, 0.34);
        background: rgba(170, 255, 0, 0.08);
    }

    .fc-profile__lang-option--soon {
        opacity: 0.58;
        cursor: not-allowed;
    }

    .fc-profile__lang-flag {
        font-size: 30px;
        line-height: 1;
    }

    .fc-profile__lang-name {
        color: var(--fc-profile-heading);
        font-size: 15px;
        font-weight: 800;
    }

    .fc-profile__lang-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        padding: 4px 10px;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1;
        text-transform: uppercase;
    }

    .fc-profile__lang-badge--available {
        color: var(--fc-profile-green);
        background: rgba(170, 255, 0, 0.12);
    }

    .fc-profile__lang-badge--soon {
        color: rgba(255, 255, 255, 0.62);
        background: rgba(255, 255, 255, 0.08);
    }

    .fc-profile__plan-current {
        display: flex;
        align-items: center;
        padding-block-end: 2px;
    }

    .fc-profile__membership-list {
        display: grid;
        gap: 14px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .fc-profile__membership-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 18px;
        background: rgba(8, 9, 8, 0.74);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
    }

    .fc-profile__membership-row--danger {
        border-color: rgba(255, 45, 85, 0.28);
        background: rgba(255, 45, 85, 0.04);
    }

    .fc-profile__membership-info {
        flex: 1;
        min-inline-size: 0;
    }

    .fc-profile__membership-info strong {
        display: block;
        margin-block-end: 6px;
        color: var(--fc-profile-heading);
        font-size: 15px;
        font-weight: 800;
        line-height: 1.25;
    }

    .fc-profile__membership-info p {
        margin: 0;
        color: var(--fc-profile-muted);
        font-size: 14px;
        line-height: 1.5;
    }

    .fc-profile__billing-loading {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-block: 12px;
        color: var(--fc-profile-muted);
        font-size: 14px;
    }

    .fc-profile__billing-loading[hidden],
    .fc-profile__billing-wrap[hidden] {
        display: none;
    }

    .fc-profile__billing-wrap {
        overflow-x: auto;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        background: rgba(8, 9, 8, 0.54);
    }

    .fc-profile__billing-table {
        inline-size: 100%;
        min-inline-size: 440px;
        border-collapse: collapse;
        font-size: 14px;
    }

    .fc-profile__billing-table thead th {
        padding: 14px 22px;
        color: rgba(255, 255, 255, 0.62);
        font-size: 11px;
        font-weight: 800;
        letter-spacing: 0.08em;
        line-height: 1.2;
        text-align: left;
        text-transform: uppercase;
        background: rgba(255, 255, 255, 0.03);
        border-block-end: 1px solid rgba(255, 255, 255, 0.08);
    }

    .fc-profile__billing-table tbody tr {
        border-block-end: 1px solid rgba(255, 255, 255, 0.06);
    }

    .fc-profile__billing-table tbody tr:last-child {
        border-block-end: 0;
    }

    .fc-profile__billing-table tbody tr:hover {
        background: rgba(255, 255, 255, 0.03);
    }

    .fc-profile__billing-table tbody td {
        padding: 15px 22px;
        color: rgba(255, 255, 255, 0.82);
        vertical-align: middle;
    }

    /* First/last cells get a touch more breathing room from the container edge. */
    .fc-profile__billing-table thead th:first-child,
    .fc-profile__billing-table tbody td:first-child {
        padding-inline-start: 24px;
    }

    .fc-profile__billing-table thead th:last-child,
    .fc-profile__billing-table tbody td:last-child {
        padding-inline-end: 24px;
    }

    .fc-profile__billing-status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-block-size: 22px;
        border-radius: 999px;
        padding: 4px 10px;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.06em;
        line-height: 1;
        text-transform: uppercase;
    }

    .fc-profile__billing-status[data-status="paid"] {
        color: var(--fc-profile-green);
        background: rgba(170, 255, 0, 0.12);
        border: 1px solid rgba(170, 255, 0, 0.26);
    }

    .fc-profile__billing-status[data-status="pending"] {
        color: #f6e27b;
        background: rgba(246, 226, 123, 0.12);
        border: 1px solid rgba(246, 226, 123, 0.24);
    }

    .fc-profile__billing-status[data-status="failed"] {
        color: var(--fc-profile-red);
        background: rgba(255, 45, 85, 0.1);
        border: 1px solid rgba(255, 45, 85, 0.24);
    }

    /* Membership / next-charge summary shown above the statements table. */
    .fc-profile__billing-summary {
        margin: 0 0 14px;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 700;
        color: var(--fc-profile-muted);
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .fc-profile__billing-summary[data-state="cancelling"] {
        color: #f6e27b;
        background: rgba(246, 226, 123, 0.1);
        border-color: rgba(246, 226, 123, 0.22);
    }

    .fc-profile__billing-summary strong {
        color: #fff;
        font-weight: 900;
    }

    /* Left-aligned like every other column (consistent), tabular figures, no wrap. */
    .fc-profile__billing-amount {
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .fc-profile__billing-empty,
    .fc-profile__payment-empty {
        margin: 0;
        padding: 18px;
        color: var(--fc-profile-muted);
        background: rgba(8, 9, 8, 0.54);
        border: 1px dashed rgba(255, 255, 255, 0.16);
        border-radius: 10px;
        font-size: 15px;
        line-height: 1.5;
    }

    .fc-profile__payment {
        display: grid;
        gap: 14px;
    }

    .fc-profile__payment-card {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 16px;
        align-items: center;
        padding: 18px;
        color: var(--fc-profile-text);
        background: rgba(8, 9, 8, 0.74);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

    .fc-profile__payment-brand {
        color: var(--fc-profile-heading);
        font-size: 15px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .fc-profile__payment-dots,
    .fc-profile__payment-exp {
        color: rgba(255, 255, 255, 0.78);
        font-size: 15px;
    }

    .fc-profile__payment-name {
        margin: 0;
        color: var(--fc-profile-muted);
        font-size: 14px;
    }

    .fc-profile__spinner {
        display: inline-block;
        flex-shrink: 0;
        inline-size: 16px;
        block-size: 16px;
        border: 2px solid rgba(255, 255, 255, 0.16);
        border-block-start-color: var(--fc-profile-green);
        border-radius: 50%;
        animation: fc-profile-spin 0.7s linear infinite;
    }

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

    .fc-profile__dialog {
        position: fixed;
        inset: 0;
        inline-size: min(460px, calc(100vw - 40px));
        max-inline-size: min(460px, calc(100vw - 40px));
        margin: auto;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--fc-profile-text);
        opacity: 0;
        transform: translateY(-12px);
        transition: opacity var(--transition-time, 180ms) ease-in-out,
            transform var(--transition-time, 180ms) ease-in-out;
    }

    .fc-profile__dialog[open] {
        opacity: 1;
        transform: translateY(0);
    }

    .fc-profile__dialog::backdrop {
        background: rgba(0, 0, 0, 0.72);
        backdrop-filter: blur(3px);
    }

    .fc-profile__dialog-inner {
        display: grid;
        gap: 16px;
        padding: 28px;
        background: #121512;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.44);
    }

    .fc-profile__dialog-title {
        margin: 0;
        color: var(--fc-profile-heading);
        font-size: 21px;
        font-weight: 800;
        line-height: 1.25;
    }

    .fc-profile__dialog-body {
        margin: 0;
        color: var(--fc-profile-muted);
        font-size: 15px;
        line-height: 1.6;
    }

    .fc-profile__dialog-body strong,
    .fc-profile__dialog .fc-profile__field strong {
        color: var(--fc-profile-heading);
    }

    .fc-profile__dialog-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        justify-content: flex-end;
    }

    @media (max-width: 960px) {
        .fc-profile.center-content {
            --section-gutter: 20px;
        }

        .fc-profile__layout {
            grid-template-columns: 1fr;
            gap: 24px;
            padding-block: 36px 24px;
        }

        .fc-profile__sidebar {
            position: static;
            text-align: left;
            grid-template-columns: auto minmax(0, 1fr);
            align-items: center;
        }

        .fc-profile__avatar {
            grid-row: span 3;
            margin-inline: 0;
        }

        .fc-profile__tier-badge {
            justify-self: start;
        }

        .fc-profile__nav-list {
            grid-column: 1 / -1;
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding-block-start: 14px;
            padding-block-end: 2px;
            scrollbar-width: thin;
        }

        .fc-profile__nav-link {
            min-block-size: 36px;
            white-space: nowrap;
        }
    }

    @media (max-width: 640px) {
        .fc-profile.center-content {
            --section-gutter: 14px;
        }

        .fc-profile__layout {
            padding-block-start: 24px;
        }

        .fc-profile__sidebar,
        .fc-profile__card {
            padding: 18px;
            border-radius: 10px;
        }

        .fc-profile__card {
            gap: 18px;
        }

        .fc-profile__card-title {
            font-size: 20px;
        }

        .fc-profile__form--grid {
            grid-template-columns: 1fr;
        }

        .fc-profile__field--span2 {
            grid-column: auto;
        }

        .fc-profile__membership-row {
            align-items: stretch;
            flex-direction: column;
        }

        .fc-profile__actions,
        .fc-profile__dialog-actions {
            align-items: stretch;
            flex-direction: column;
        }

        .fc-profile .button,
        .fc-profile__dialog .button {
            inline-size: 100%;
        }

        .fc-profile__payment-card {
            align-items: flex-start;
            flex-direction: column;
        }
    }

    .fc-profile[data-component="profile"] .fc-profile__avatar {
        inline-size: 56px;
        block-size: 56px;
    }

    .fc-profile[data-component="profile"] .fc-profile__avatar-initials {
        font-size: 19px;
    }

    .fc-profile[data-component="profile"] .fc-profile__nav-list {
        padding-top: 16px;
        padding-right: 10px;
        padding-bottom: 0;
        padding-left: 10px;
    }

    .fc-profile[data-component="profile"] .fc-profile__nav-link {
        box-sizing: border-box;
        width: 100%;
        padding-right: 12px;
        padding-left: 12px;
    }
}

.fc-profile[data-component="profile"] .fc-profile__nav-list {
    padding-top: 16px;
    padding-right: 10px;
    padding-bottom: 0;
    padding-left: 10px;
}

.fc-profile[data-component="profile"] .fc-profile__nav-link {
    box-sizing: border-box;
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
}

.fc-profile[data-component="profile"] .fc-profile__avatar {
    justify-self: center;
    margin-block-start: 8px;
    margin-block-end: 8px;
    margin-inline: auto;
}

.fc-profile[data-component="profile"] .fc-profile__sidebar-name {
    margin-top: 0;
}

.fc-profile[data-component="profile"] .fc-profile__card {
    box-sizing: border-box;
    padding: 28px 38px;
    background: #292929;
}

.fc-profile[data-component="profile"] input,
.fc-profile[data-component="profile"] textarea,
.fc-profile[data-component="profile"] select {
    box-sizing: border-box;
    padding-left: 5px;
}

.fc-profile[data-component="profile"] #fc-pw-submit {
    box-sizing: border-box;
    min-width: 190px;
    padding-right: 24px;
    padding-left: 24px;
    font-size: 18px;
}

.fc-profile[data-component="profile"] #fc-pw-submit:disabled {
    color: rgba(255, 255, 255, 0.44);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    cursor: not-allowed;
    opacity: 1;
    pointer-events: auto;
}

.fc-profile[data-component="profile"] #fc-payment-change {
    box-sizing: border-box;
    min-width: 190px;
    padding-right: 24px;
    padding-left: 24px;
    font-size: 18px;
}

.fc-profile[data-component="profile"] .fc-profile__password-wrap {
    display: grid;
    position: relative;
}

.fc-profile[data-component="profile"] .fc-profile__password-wrap input {
    padding-right: 48px;
}

.fc-profile[data-component="profile"] .fc-profile__password-toggle {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 8px;
    display: grid;
    align-items: center;
    justify-content: center;
    width: 36px;
    padding: 4px;
    color: rgba(255, 255, 255, 0.58);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition:
        color var(--transition-time, 180ms) ease-in-out,
        transform 150ms ease-in-out;
}

.fc-profile[data-component="profile"] .fc-profile__password-toggle:hover,
.fc-profile[data-component="profile"] .fc-profile__password-toggle:focus-visible {
    color: rgba(255, 255, 255, 0.9);
    outline: none;
}

.fc-profile[data-component="profile"] .fc-profile__password-toggle:active {
    transform: scale(0.96);
}

.fc-profile[data-component="profile"] .fc-profile__eye-icon {
    font-size: 16px;
    line-height: 1;
}

.fc-profile[data-component="profile"] .fc-profile__field-error {
    color: #ff8aa2;
    font-size: 12px;
    line-height: 1.35;
}

.fc-profile[data-component="profile"] .fc-profile__field-error[hidden] {
    display: none;
}

.fc-profile[data-component="profile"] .fc-profile__field input.is-error {
    border-color: var(--fc-profile-red);
    box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.14);
}

.fc-profile[data-component="profile"] .fc-profile__field input.is-valid {
    border-color: var(--fc-profile-green);
}

.fc-profile[data-component="profile"] .fc-profile__password-strength {
    display: grid;
    gap: 6px;
}

.fc-profile[data-component="profile"] .fc-profile__password-strength[hidden] {
    display: none;
}

.fc-profile[data-component="profile"] .fc-profile__strength-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.fc-profile[data-component="profile"] .fc-profile__strength-segment {
    height: 5px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}

.fc-profile[data-component="profile"] .fc-profile__strength-segment.is-filled {
    background: var(--fc-profile-green);
}

.fc-profile[data-component="profile"] .fc-profile__password-strength[data-strength="1"] .fc-profile__strength-segment.is-filled {
    background: var(--fc-profile-red);
}

.fc-profile[data-component="profile"] .fc-profile__password-strength[data-strength="2"] .fc-profile__strength-segment.is-filled,
.fc-profile[data-component="profile"] .fc-profile__password-strength[data-strength="3"] .fc-profile__strength-segment.is-filled {
    background: #f5b642;
}

.fc-profile[data-component="profile"] .fc-profile__strength-label {
    color: var(--fc-profile-muted);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

/* Billing table cell padding — UNLAYERED + high-specificity so it outranks the @layer
   rules (the rest of the profile page is styled unlayered, which beats any @layer). Physical
   padding-left/right to avoid the logical-vs-shorthand cascade ambiguity that was leaving the
   first column ("Jun …") flush against the table edge. */
.fc-profile[data-component="profile"] .fc-profile__billing-table th,
.fc-profile[data-component="profile"] .fc-profile__billing-table td {
    padding: 15px 22px;
}

.fc-profile[data-component="profile"] .fc-profile__billing-table th:first-child,
.fc-profile[data-component="profile"] .fc-profile__billing-table td:first-child {
    padding-left: 26px;
}

.fc-profile[data-component="profile"] .fc-profile__billing-table th:last-child,
.fc-profile[data-component="profile"] .fc-profile__billing-table td:last-child {
    padding-right: 26px;
}

/* Status badge padding — unlayered so it isn't shadowed by @layer (same reason as the cells). */
.fc-profile[data-component="profile"] .fc-profile__billing-status {
    padding: 5px 13px;
}

/* ── Membership plan chooser (unlayered — the profile page styles unlayered) ───── */
.fc-profile[data-component="profile"] .fc-profile__plan-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-block-end: 20px;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option {
    position: relative;
    display: block;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.fc-profile[data-component="profile"] .fc-profile__plan-option input {
    position: absolute;
    inset-block-start: 16px;
    inset-inline-end: 16px;
    inline-size: 18px;
    block-size: 18px;
    accent-color: #aaff00;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option:has(input:checked) {
    border-color: rgba(170, 255, 0, 0.55);
    background: rgba(170, 255, 0, 0.07);
}

.fc-profile[data-component="profile"] .fc-profile__plan-option:has(input:focus-visible) {
    outline: 2px solid rgba(170, 255, 0, 0.6);
    outline-offset: 2px;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option-body {
    display: grid;
    gap: 4px;
    padding-inline-end: 28px;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option-name {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option-price {
    color: #aaff00;
    font-size: 14px;
    font-weight: 800;
}

.fc-profile[data-component="profile"] .fc-profile__plan-option-desc {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.4;
}

.fc-profile[data-component="profile"] .fc-profile__plan-save {
    color: #111410;
    background: #aaff00;
    border: 1px solid #aaff00;
    font-weight: 800;
}

.fc-profile[data-component="profile"] .fc-profile__plan-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Danger Zone ─────────────────────────────────────────────────── */
.fc-profile[data-component="profile"] .fc-profile__card--danger {
    border-color: rgba(255, 45, 85, 0.3);
}

.fc-profile[data-component="profile"] .fc-profile__danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.fc-profile[data-component="profile"] .fc-profile__nav-link--danger {
    color: rgba(255, 138, 162, 0.85);
}

/* Save-changes button + language badges — unlayered (the @layer padding was being shadowed). */
.fc-profile[data-component="profile"] .fc-profile__plan-save {
    padding: 11px 22px;
}

.fc-profile[data-component="profile"] .fc-profile__lang-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 11px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.fc-profile[data-component="profile"] .fc-profile__lang-badge--available {
    color: #aaff00;
    background: rgba(170, 255, 0, 0.12);
}

.fc-profile[data-component="profile"] .fc-profile__lang-badge--soon {
    color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.08);
}

/* Global padding for in-page profile buttons. The base .button (main.css) defines NO padding —
   only the button-primary/secondary modifiers do — so unmodified buttons (Save changes) and
   button-danger (Delete account) rendered with no horizontal padding. */
.fc-profile[data-component="profile"] .button {
    padding: 12px 22px;
}

/* Language option stack + spacing — unlayered so it actually applies (flag near the name, room
   under the badge). */
.fc-profile[data-component="profile"] .fc-profile__lang-option {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 22px 16px 24px;
}

.fc-profile[data-component="profile"] .fc-profile__lang-flag {
    margin-block-end: 2px;
}

.fc-profile[data-component="profile"] .fc-profile__lang-badge {
    margin-block-start: 8px;
}

/* Tier badge (sidebar) + plan label — unlayered padding (the @layer padding was shadowed). */
.fc-profile[data-component="profile"] .fc-profile__tier-badge,
.fc-profile[data-component="profile"] .fc-profile__plan-label {
    padding: 7px 13px;
}

/* ── In-app payment methods (unlayered) ──────────────────────────── */
.fc-profile[data-component="profile"] .fc-profile__pm-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 14px;
}
.fc-profile[data-component="profile"] .fc-profile__pm-loading[hidden] { display: none; }

.fc-profile[data-component="profile"] .fc-profile__pm-list { display: grid; gap: 12px; }
.fc-profile[data-component="profile"] .fc-profile__pm-list[hidden] { display: none; }

.fc-profile[data-component="profile"] .fc-profile__pm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(8, 9, 8, 0.54);
}
.fc-profile[data-component="profile"] .fc-profile__pm-info {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.fc-profile[data-component="profile"] .fc-profile__pm-brand {
    color: #fff; font-weight: 800; text-transform: capitalize;
}
.fc-profile[data-component="profile"] .fc-profile__pm-dots {
    color: rgba(255, 255, 255, 0.82); font-variant-numeric: tabular-nums;
}
.fc-profile[data-component="profile"] .fc-profile__pm-exp {
    color: rgba(255, 255, 255, 0.55); font-size: 13px;
}
.fc-profile[data-component="profile"] .fc-profile__pm-badge {
    padding: 4px 11px; border-radius: 999px; font-size: 10px; font-weight: 800;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: #aaff00; background: rgba(170, 255, 0, 0.12);
}
.fc-profile[data-component="profile"] .fc-profile__pm-actions {
    display: flex; align-items: center; gap: 10px;
}
.fc-profile[data-component="profile"] .fc-profile__pm-actions .button { padding: 8px 14px; font-size: 12px; }
.fc-profile[data-component="profile"] .fc-profile__pm-remove {
    display: inline-flex; align-items: center; justify-content: center;
    inline-size: 30px; block-size: 30px; border-radius: 999px;
    border: 1px solid rgba(255, 45, 85, 0.3); background: rgba(255, 45, 85, 0.08);
    color: #ff8aa2; font-size: 18px; line-height: 1; cursor: pointer;
}
.fc-profile[data-component="profile"] .fc-profile__pm-remove:hover { background: rgba(255, 45, 85, 0.16); }
.fc-profile[data-component="profile"] .fc-profile__pm-remove:disabled { opacity: 0.5; cursor: not-allowed; }
.fc-profile[data-component="profile"] .fc-profile__pm-empty {
    margin: 0; color: rgba(255, 255, 255, 0.64); font-size: 15px;
}

/* Stripe Elements card mount (add-card dialog — outside .fc-profile) */
.fc-profile__dialog .fc-profile__card-element {
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(8, 9, 8, 0.6);
}

/* Loading state: spinner in the card slot until Stripe Elements reports 'ready' (no bare-field flash/jump). */
.fc-profile__dialog .fc-profile__card-element--loading {
    position: relative;
    min-height: 48px;
}
.fc-profile__dialog .fc-profile__card-element--loading > * {
    visibility: hidden;
}
.fc-profile__dialog .fc-profile__card-element--loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #aaff00;
    border-radius: 50%;
    animation: fc-card-spin 0.6s linear infinite;
}
@keyframes fc-card-spin {
    to { transform: rotate(360deg); }
}

/* Card-brand logo in each payment-method row. */
.fc-profile[data-component="profile"] .fc-profile__pm-logo {
    display: inline-flex;
    flex: 0 0 auto;
}
.fc-profile[data-component="profile"] .fc-profile__pm-logo svg {
    display: block;
    border-radius: 4px;
}

/* Amber "warning" alert variant (heads-up, nothing broken) — used for the pending-membership-change
   notice so a scheduled downgrade reads clearly, not as an error. */
.fc-profile__alert[data-type="warning"] {
    color: #ffcf70;
    background: rgba(255, 176, 32, 0.1);
    border: 1px solid rgba(255, 176, 32, 0.34);
}
.fc-profile__plan-state-note { margin-block-start: 4px; margin-block-end: 16px; }
.fc-profile__plan-state-note strong { color: #ffe6b0; font-weight: 700; }

/* "Current" badge on the plan the account is actually on right now, so the current state is obvious
   at a glance (distinct from whatever radio the user is hovering/picking). */
.fc-profile[data-component="profile"] .fc-profile__plan-current-badge {
    display: inline-block;
    margin-inline-start: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaff00;
    background: rgba(170, 255, 0, 0.12);
    vertical-align: middle;
}
