/*
 * Shared design of the plugin's My Account pages
 * (My Roommates, Ticket Resale, Invitation Codes, Waitlist).
 *
 * Every page is a header followed by cards. Colors stay neutral so they fit
 * the theme; buttons keep the theme's look. Page specific parts live in
 * their own stylesheet (e.g. unfamiliar-tribe.css).
 */

.uic-account {
    --uic-border: #e2e4e7;
    --uic-muted: #6b7280;
    --uic-soft: #f7f7f8;
    --uic-accent: #2f6f5e;
    --uic-danger: #b32d2e;
    --uic-success: #1e7e34;
    --uic-warning: #9a6700;

    max-width: 800px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- header */

.uic-page-header {
    margin-bottom: 1.5rem;
}

.uic-page-header h1 {
    margin-bottom: 0.25rem;
}

.uic-muted {
    color: var(--uic-muted);
    margin: 0 0 1rem;
}

/* ----------------------------------------------------------------- cards */

.uic-card {
    background: #fff;
    border: 1px solid var(--uic-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.uic-card > :last-child {
    margin-bottom: 0;
}

.uic-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--uic-border);
}

.uic-card-title {
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.uic-card-header .uic-card-title {
    margin: 0;
}

.uic-eyebrow {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--uic-muted);
    margin-bottom: 0.15rem;
}

.uic-badge {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: var(--uic-soft);
    border: 1px solid var(--uic-border);
    white-space: nowrap;
}

.uic-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--uic-accent);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    vertical-align: middle;
}

.uic-note {
    font-size: 0.9rem;
    color: var(--uic-muted);
    background: var(--uic-soft);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 1.25rem 0 0;
}

.uic-empty {
    color: var(--uic-muted);
    font-style: italic;
    margin: 0;
}

.uic-card-danger {
    border-color: #f0c7c7;
    background: #fdf6f6;
}

/* ------------------------------------------------------ option blocks */

/* Two or more alternatives next to each other, stacked on narrow screens. */
.uic-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.uic-option {
    border: 1px solid var(--uic-border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
}

.uic-option.is-recommended {
    border-color: var(--uic-accent);
    box-shadow: inset 3px 0 0 var(--uic-accent);
}

.uic-option h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin: 0 0 0.5rem;
}

.uic-option p {
    margin: 0 0 0.5rem;
}

.uic-option p:last-child {
    margin-bottom: 0;
}

/* ---------------------------------------------------------------- tables */

.uic-table-wrap {
    overflow-x: auto;
}

.uic-account table.uic-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
    margin: 0;
}

.uic-account table.uic-table th,
.uic-account table.uic-table td {
    text-align: left;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--uic-border);
    vertical-align: middle;
}

.uic-account table.uic-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--uic-muted);
    background: var(--uic-soft);
}

.uic-account table.uic-table tbody tr:last-child td {
    border-bottom: 0;
}

.uic-table .uic-col-narrow {
    width: 1%;
    white-space: nowrap;
}

.uic-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Status pills in tables. */
.uic-status {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--uic-soft);
    border: 1px solid var(--uic-border);
    white-space: nowrap;
}

.uic-status.is-positive {
    color: var(--uic-success);
    border-color: #b7dfc1;
    background: #f0f9f2;
}

.uic-status.is-pending {
    color: var(--uic-warning);
    border-color: #ecd9a8;
    background: #fdf8ea;
}

.uic-status.is-inactive {
    color: var(--uic-muted);
}

.uic-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

/* ---------------------------------------------------------------- forms */

/*
 * Fields in a row as long as there is room, wrapping on narrow screens.
 *
 * The row is aligned at the bottom, so the button lines up with the inputs
 * below their labels. For that to hold, nothing may add space under a field
 * (the theme gives paragraphs and inputs a bottom margin), and inputs and
 * button share one height - otherwise the button looks tilted against the
 * fields. The selectors start with .uic-account to outweigh the theme's.
 */
.uic-account .uic-form-row {
    --uic-control-height: 2.75rem;

    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 1rem;
    margin: 0;
}

.uic-account .uic-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 200px;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.uic-account .uic-field.is-small {
    flex: 0 1 140px;
}

.uic-account .uic-field label {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.uic-account .uic-form-row input:not([type="hidden"]):not([type="submit"]) {
    box-sizing: border-box;
    width: 100%;
    height: var(--uic-control-height);
    margin: 0;
}

.uic-account .uic-form-row .button,
.uic-account .uic-form-row button,
.uic-account .uic-form-row input[type="submit"] {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    height: var(--uic-control-height);
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
    margin: 0;
    white-space: nowrap;
}

/* ------------------------------------------------------------- messages */

.uic-message {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 0 0 1.5rem;
    border: 1px solid var(--uic-border);
    border-left-width: 4px;
}

.uic-message.is-error {
    border-color: #f0c7c7;
    border-left-color: var(--uic-danger);
    background: #fdf6f6;
}

.uic-message.is-success {
    border-color: #b7dfc1;
    border-left-color: var(--uic-success);
    background: #f0f9f2;
}

.uic-message.is-info {
    border-color: #c5d9ed;
    border-left-color: #2271b1;
    background: #f0f6fc;
}

.uic-message .uic-card-title {
    margin: 0 0 0.5rem;
}

.uic-message p:last-child {
    margin-bottom: 0;
}

.uic-message .order-mates-join {
    margin: 0.5rem 0;
}

/* -------------------------------------------------------------- waitlist */

/*
 * The waitlist form comes from Event Tickets Plus. Its own stylesheet gives
 * it a title with a large top margin and right-aligned buttons; inside a card
 * it should read like the other cards. The selectors carry one class more
 * than the plugin's, because its stylesheet is printed after ours.
 */
.uic-account .uic-card .tec-tickets-plus-waitlist-container h3 {
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.uic-account .uic-card .tec-tickets-plus-waitlist-container p {
    color: var(--uic-muted);
    margin: 0 0 1rem;
}

.uic-account .uic-card .tec-tickets-plus-waitlist-container--submit {
    justify-content: flex-start;
    margin-bottom: 0;
}

.uic-account .uic-card .tec-tickets-plus-waitlist-container__success-row {
    margin: 0;
}

/* ------------------------------------------------------------- my tickets */

/*
 * The attendee list on My Tickets comes from Event Tickets. Its "box" is a
 * stack of bordered .tribe-item rows (all but the last without a bottom
 * border), so the corners are rounded on the first and last row - a radius
 * on the list itself would clip the border lines at the corners. Same radius
 * as the cards of the other account pages. Event Tickets sets no radius on
 * these rows, so the selector does not need to outweigh its rules, and it
 * does not depend on the surrounding markup, which the theme overrides.
 *
 * :first-of-type / :last-of-type instead of :first-child / :last-child: the
 * template puts a hidden <input> in front of every <li> inside the list, so
 * the first child of the list is never a row.
 */
.tec__tickets-my-tickets-order-tickets-list-wrapper .tribe-tickets-list > .tribe-item:first-of-type {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.tec__tickets-my-tickets-order-tickets-list-wrapper .tribe-tickets-list > .tribe-item:last-of-type {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ------------------------------------------------------------------ small */

@media (max-width: 480px) {
    .uic-card {
        padding: 1.1rem;
    }

    .uic-card-title {
        font-size: 1.2rem;
    }
}
