/* =========================================================
ACCOUNT / PROFILE
========================================================= */

.rb-account-header {
    margin-bottom: 28px;
}

.rb-account-header h1 {
    margin: 7px 0 8px;

    font-size: clamp(
        38px,
        5vw,
        58px
    );

    line-height: 1;
    letter-spacing: -.045em;
}

.rb-account-header p {
    max-width: 720px;
    margin: 0;

    color: var(--rb-text-muted);
}


/* Form
--------------------------------------------------------- */

.rb-profile-form {
    display: grid;
    gap: 20px;

    min-width: 0;
}

.rb-profile-form *,
.rb-profile-form *::before,
.rb-profile-form *::after {
    box-sizing: border-box;
}


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

.rb-account-card {
    min-width: 0;
    padding: 28px;

    background: var(--rb-surface);
    border: 1px solid var(--rb-border);
    border-radius: 12px;
}

.rb-account-card__heading {
    margin-bottom: 24px;
}

.rb-account-card__heading h2 {
    margin: 0 0 6px;

    font-size: 22px;
    line-height: 1.2;
}

.rb-account-card__heading p {
    max-width: 760px;
    margin: 0;

    color: var(--rb-text-muted);
    line-height: 1.55;
}


/* Grid
--------------------------------------------------------- */

.rb-profile-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 20px;

    align-items: start;

    width: 100%;
    min-width: 0;
}

.rb-profile-grid > * {
    min-width: 0;
}

.rb-profile-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: max-content;
    align-content: start;
    align-self: start;
    gap: 7px;

    width: 100%;
    min-width: 0;
}

.rb-profile-field--wide {
    grid-column: 1 / -1;
}


/* Labels
--------------------------------------------------------- */

.rb-profile-field label,
.rb-profile-contact__main label {
    display: block;

    margin: 0;

    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;

    color: var(--rb-text);
}


/* Inputs / selects
--------------------------------------------------------- */

.rb-profile-field input,
.rb-profile-field select,
.rb-profile-contact__main input {
    display: block;

    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 50px;
    min-height: 50px;

    margin: 0;
    padding: 0 14px;

    color: var(--rb-text);

    font: inherit;
    line-height: normal;

    background: var(--rb-background);

    border: 1px solid var(--rb-border);
    border-radius: 7px;

    outline: none;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        background-color .18s ease;
}

.rb-profile-field input:focus,
.rb-profile-field select:focus,
.rb-profile-contact__main input:focus {
    border-color: var(--rb-primary);

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--rb-primary) 14%,
            transparent
        );
}

.rb-profile-field input[readonly] {
    cursor: not-allowed;

    color: var(--rb-text-muted);
    background: var(--rb-surface);
}

.rb-profile-field small {
    display: block;

    margin: 0;

    color: var(--rb-text-muted);

    font-size: 12px;
    line-height: 1.45;
}


/* Read-only value box
--------------------------------------------------------- */

.rb-profile-field > strong {
    display: flex;
    align-items: center;

    width: 100%;
    min-width: 0;
    min-height: 50px;

    padding: 0 14px;

    background: var(--rb-background);

    border: 1px solid var(--rb-border);
    border-radius: 7px;
}


/* Account type
--------------------------------------------------------- */

.rb-profile-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    cursor: pointer;

    font-weight: 700;
}

.rb-profile-switch input {
    flex: 0 0 auto;

    width: 18px;
    height: 18px;

    margin: 0;
}

.rb-profile-company {
    width: 100%;
    max-width: 540px;

    margin-top: 22px;
}

.rb-profile-company[hidden] {
    display: none;
}


/* Contacts
--------------------------------------------------------- */

.rb-profile-contacts {
    display: grid;
    gap: 12px;

    min-width: 0;
}

.rb-profile-contact {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        auto;

    gap: 18px;
    align-items: end;

    min-width: 0;

    padding: 16px;

    background: var(--rb-background);

    border: 1px solid var(--rb-border);
    border-radius: 8px;
}

.rb-profile-contact > * {
    min-width: 0;
}

.rb-profile-contact__main {
    display: grid;
    gap: 7px;

    min-width: 0;
}

.rb-profile-contact__option {
    display: flex;
    align-items: center;
    gap: 7px;

    min-height: 50px;

    cursor: pointer;

    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
}

.rb-profile-contact__option input {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;

    margin: 0;
}


/* Account status
--------------------------------------------------------- */

.rb-profile-status {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 16px;

    min-width: 0;
}

.rb-profile-status > div {
    display: flex;
    flex-direction: column;
    gap: 4px;

    min-width: 0;

    padding: 16px;

    background: var(--rb-background);

    border: 1px solid var(--rb-border);
    border-radius: 8px;
}

.rb-profile-status span {
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .06em;
    text-transform: uppercase;

    color: var(--rb-text-muted);
}

.rb-profile-status strong {
    overflow-wrap: anywhere;
}


/* Actions
--------------------------------------------------------- */

.rb-profile-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.rb-profile-actions .rb-button {
    min-height: 48px;
}


/* Messages
--------------------------------------------------------- */

.rb-account-message {
    margin-bottom: 20px;
    padding: 14px 16px;

    border-radius: 8px;
}

.rb-account-message p {
    margin: 0;
}

.rb-account-message p + p {
    margin-top: 5px;
}

.rb-account-message--success {
    background: #edf8ef;
    border: 1px solid #a9d8af;
}

.rb-account-message--error {
    color: #711712;
    background: #fff1f0;
    border: 1px solid #f0b3af;
}


/* =========================================================
ALERTS
========================================================= */

.rb-alert {
    position: relative;

    margin: 0 0 28px;
    padding: 18px 20px;

    color: var(--rb-text);
    background: var(--rb-surface);

    border: 1px solid var(--rb-border);
    border-left-width: 4px;
    border-radius: 10px;
}

.rb-alert strong {
    display: block;

    margin: 0;

    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
}

.rb-alert p {
    margin: 7px 0 0;

    font-size: 14px;
    line-height: 1.55;
}

.rb-alert p + p {
    margin-top: 6px;
}


/* Success
--------------------------------------------------------- */

.rb-alert--success {
    color: #14532d;

    background: #f0fdf4;

    border-color: #bbf7d0;
    border-left-color: #22c55e;
}

.rb-alert--success strong {
    color: #166534;
}


/* Error
--------------------------------------------------------- */

.rb-alert--error {
    color: #7f1d1d;

    background: #fef2f2;

    border-color: #fecaca;
    border-left-color: #dc2626;
}

.rb-alert--error strong {
    color: #991b1b;
}


/* Warning
--------------------------------------------------------- */

.rb-alert--warning {
    color: #78350f;

    background: #fffbeb;

    border-color: #fde68a;
    border-left-color: #f59e0b;
}

.rb-alert--warning strong {
    color: #92400e;
}


/* =========================================================
MY ADS
========================================================= */

.rb-my-ads-page {
    min-width: 0;
}


/* Header
--------------------------------------------------------- */

.rb-my-ads-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;

    min-width: 0;
    margin-bottom: 26px;
}

.rb-my-ads-header > div {
    min-width: 0;
}

.rb-my-ads-header h1 {
    margin: 7px 0 8px;
}

.rb-my-ads-header p {
    margin: 0;

    color: var(--rb-text-muted);
}

.rb-my-ads-header > .rb-button {
    flex: 0 0 auto;

    min-height: 52px;
    padding: 0 24px;

    white-space: nowrap;
}


/* Tabs
--------------------------------------------------------- */

.rb-my-ads-tabs {
    display: inline-grid;

    grid-template-columns:
        repeat(
            3,
            minmax(145px, 1fr)
        );

    gap: 5px;

    width: auto;
    max-width: 100%;

    margin: 0 0 28px;
    padding: 5px;

    background: var(--rb-surface);

    border: 1px solid var(--rb-border);
    border-radius: 12px;
}

.rb-my-ads-tabs__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    min-width: 0;
    min-height: 48px;

    padding: 0 14px;

    color: var(--rb-text);
    text-decoration: none;

    background: var(--rb-background);

    border-radius: 8px;

    transition:
        color .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

.rb-my-ads-tabs__item span {
    min-width: 0;

    font-size: 14px;
    font-weight: 800;

    white-space: nowrap;
}

.rb-my-ads-tabs__item strong {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    min-width: 26px;
    height: 26px;

    padding: 0 7px;

    color: var(--rb-text);
    background: var(--rb-surface);

    border: 1px solid var(--rb-border);
    border-radius: 999px;

    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.rb-my-ads-tabs__item.is-active,
.rb-my-ads-tabs__item[aria-current="page"] {
    color: #fff;

    background: var(
        --rb-primary,
        #e10600
    );

    box-shadow:
        0 3px 10px
        rgba(0, 0, 0, .10);
}

.rb-my-ads-tabs__item.is-active span,
.rb-my-ads-tabs__item[aria-current="page"] span {
    color: #fff;
}

.rb-my-ads-tabs__item.is-active strong,
.rb-my-ads-tabs__item[aria-current="page"] strong {
    color: #fff;

    background:
        rgba(
            255,
            255,
            255,
            .18
        );

    border-color:
        rgba(
            255,
            255,
            255,
            .22
        );
}


/* Listing
--------------------------------------------------------- */

.rb-my-ads-page .rb-listing-stream {
    align-items: stretch;
    gap: 22px;
}


/* Card
--------------------------------------------------------- */

.rb-my-ad-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    height: 100%;

    overflow: hidden;
}

.rb-my-ad-card .rb-ad-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;

    min-width: 0;
}

.rb-my-ad-card .rb-ad-card__footer {
    margin-top: auto;
}


/* Status badges
--------------------------------------------------------- */

.rb-my-ad-card__status {
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    z-index: 3;

    display: inline-flex;
    align-items: center;

    min-height: 28px;
    padding: 0 10px;

    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;

    color: #374151;
    background:
        rgba(
            255,
            255,
            255,
            .94
        );

    border-radius: 999px;

    box-shadow:
        0 2px 8px
        rgba(0, 0, 0, .08);

    backdrop-filter: blur(6px);
}

.rb-my-ad-card .rb-ad-card__featured {
    top: 12px;
    right: auto;
    left: 12px;
    z-index: 3;
}

.rb-my-ad-card__status--published {
    color: #166534;
    background: #dcfce7;
}

.rb-my-ad-card__status--pending {
    color: #854d0e;
    background: #fef9c3;
}

.rb-my-ad-card__status--draft {
    color: #374151;
    background: #f3f4f6;
}

.rb-my-ad-card__status--rejected {
    color: #991b1b;
    background: #fee2e2;
}

.rb-my-ad-card__status--expired {
    color: #9a3412;
    background: #ffedd5;
}

.rb-my-ad-card__status--archived {
    color: #374151;
    background: #e5e7eb;
}


/* Card actions
--------------------------------------------------------- */

.rb-my-ad-card__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;

    width: 100%;
    margin-top: 18px;
}

.rb-my-ad-card__actions > form,
.rb-my-ad-card__actions > .rb-button,
.rb-my-ad-card__archive-form {
    width: 100%;
    margin: 0;
}

.rb-my-ad-card__actions .rb-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 44px;

    padding: 9px 12px;

    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;

    white-space: normal;
}

.rb-my-ad-card__archive-form .rb-button--danger {
    color: #fff;

    background:
        var(
            --rb-primary,
            #e10600
        );

    border:
        1px solid
        var(
            --rb-primary,
            #e10600
        );
}


/* Empty state
--------------------------------------------------------- */

.rb-my-ads-page .rb-listing-empty {
    margin-top: 4px;
}


/* =========================================================
TABLET
========================================================= */

@media (max-width: 900px) {

    .rb-profile-grid {
        gap: 16px;
    }

    .rb-account-card {
        padding: 24px;
    }

    .rb-profile-contact {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            auto;

        gap: 12px;
    }

    .rb-my-ads-header {
        align-items: flex-start;
    }

    .rb-my-ads-tabs {
        display: grid;

        width: 100%;

        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }
}


/* =========================================================
MOBILE
========================================================= */

@media (max-width: 767px) {

    .rb-account-header {
        margin-bottom: 22px;
    }

    .rb-account-header h1 {
        font-size: clamp(
            36px,
            10vw,
            48px
        );
    }

    .rb-profile-form {
        gap: 16px;
    }

    .rb-account-card {
        padding: 20px;

        border-radius: 10px;
    }

    .rb-account-card__heading {
        margin-bottom: 20px;
    }

    .rb-account-card__heading h2 {
        font-size: 20px;
    }

    .rb-profile-grid,
    .rb-profile-status {
        grid-template-columns: 1fr;
    }

    .rb-profile-field--wide {
        grid-column: auto;
    }

    .rb-profile-company {
        max-width: none;
    }

    .rb-profile-contact {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rb-profile-contact__option {
        min-height: auto;
    }

    .rb-profile-actions {
        display: block;
    }

    .rb-profile-actions .rb-button {
        width: 100%;
        justify-content: center;
    }


    /* My Ads */

    .rb-my-ads-header {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;

        margin-bottom: 20px;
    }

    .rb-my-ads-header > .rb-button {
        width: 100%;

        justify-content: center;
    }

    .rb-my-ads-tabs {
        display: grid;

        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );

        gap: 4px;

        width: 100%;

        margin-bottom: 20px;
        padding: 4px;
    }

    .rb-my-ads-tabs__item {
        flex-direction: column;
        justify-content: center;
        gap: 5px;

        min-width: 0;
        min-height: 62px;

        padding: 7px 4px;

        text-align: center;
    }

    .rb-my-ads-tabs__item span {
        max-width: 100%;

        overflow: hidden;

        font-size: 12px;

        text-overflow: ellipsis;
    }

    .rb-my-ads-tabs__item strong {
        min-width: 23px;
        height: 23px;

        padding: 0 6px;

        font-size: 10px;
    }

    .rb-my-ad-card__actions .rb-button {
        min-height: 46px;
    }
}


/* =========================================================
SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .rb-account-card {
        padding: 18px;
    }

    .rb-profile-grid {
        gap: 16px;
    }

    .rb-profile-field input,
    .rb-profile-field select,
    .rb-profile-contact__main input {
        height: 48px;
        min-height: 48px;

        padding-right: 12px;
        padding-left: 12px;
    }

    .rb-my-ads-page .rb-listing-header h1 {
        font-size: clamp(
            34px,
            11vw,
            46px
        );
    }

    .rb-my-ads-tabs {
        border-radius: 10px;
    }

    .rb-my-ad-card__status {
        top: 10px;
        right: 10px;
        left: auto;

        min-height: 26px;
        padding: 0 8px;

        font-size: 10px;
    }

    .rb-my-ad-card .rb-ad-card__featured {
        top: 10px;
        right: auto;
        left: 10px;
    }
}

.rb-profile-password-toggle {
    display: flex;
    align-items: center;
}

.rb-profile-password {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--rb-border);
}

.rb-profile-password[hidden] {
    display: none;
}

.rb-profile-password__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 24px;
}