@import url('./main-layout.css');
@import url('./cloud.css');
@import url('./promotions.css');
@import url('./settings.css');
@import url('./people.css');
@import url('./lists-forms.css');
@import url('./ui.css');
/* Star Pass itself comes in as this theme's parent (theme.json): importing its styles.css here again pointed at a
   development-only path, which production browsers refused. */

.settings-section {
    min-width: 0;
    max-width: 100%;
}

.magic-link-view {
    padding: var(--lumo-space-l);
    box-sizing: border-box;
}

.magic-link-card {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: var(--lumo-space-l);
    background-color: var(--lumo-base-color);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
}

.magic-link-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    border-radius: var(--lumo-border-radius-l);
    background-color: var(--lumo-contrast-5pct);
}

.magic-link-heading {
    margin: 0;
    font-weight: 700;
    font-size: 1.75rem;
}

.magic-link-subtitle {
    margin: 0;
    color: var(--lumo-secondary-text-color);
}

.magic-link-banner {
    padding: var(--lumo-space-m);
    background-color: var(--lumo-contrast-5pct);
    border-radius: var(--lumo-border-radius-m);
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-body-text-color);
}

.magic-link-secondary-action {
    align-self: center;
}

/* Fixed light-bg/dark-text badge colors, regardless of theme - same reasoning as the OAuth brand buttons above. */
.magic-link-status-badge {
    display: inline-block;
    padding: var(--lumo-space-xs) var(--lumo-space-s);
    border-radius: var(--lumo-border-radius-m);
    font-size: var(--lumo-font-size-xs);
    font-weight: 600;
    line-height: 1.4;
}

.magic-link-status-badge-active {
    background-color: #ecfccb;
    color: #365314;
}

.magic-link-status-badge-used {
    background-color: #dbeafe;
    color: #1e3a8a;
}

.magic-link-status-badge-disabled {
    background-color: #f3f4f6;
    color: #374151;
}

.magic-link-status-badge-expired {
    background-color: #fee2e2;
    color: #991b1b;
}
/* The "From SunDevs" card on the admin dashboard (SunDevsTipCard). One fixed height per card width, whatever the
   tip says, so showing the next tip never moves the page. The card is its own size container: the narrow layout
   follows the dashboard's width, not the window's (the drawer takes part of it). */
.sundevs-tip {
    container-type: inline-size;
    width: 100%;
    flex: none;
}

.sundevs-tip__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "icon body actions menu";
    align-items: center;
    column-gap: var(--lumo-space-m);
    height: 7.25rem;
    box-sizing: border-box;
    padding: var(--lumo-space-m) var(--lumo-space-s) var(--lumo-space-m) var(--lumo-space-l);
    background: var(--lumo-base-color);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
    overflow: hidden;
}

.sundevs-tip__icon {
    grid-area: icon;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--lumo-border-radius-l);
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-text-color);
}

.sundevs-tip__icon vaadin-icon {
    width: var(--lumo-icon-size-m);
    height: var(--lumo-icon-size-m);
}

.sundevs-tip--update .sundevs-tip__icon {
    background: var(--lumo-success-color-10pct);
    color: var(--lumo-success-text-color);
}

.sundevs-tip--security .sundevs-tip__icon {
    background: var(--lumo-error-color-10pct);
    color: var(--lumo-error-text-color);
}

.sundevs-tip__body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.sundevs-tip__eyebrow-line {
    gap: var(--lumo-space-s);
    min-height: 1.25rem;
}

.sundevs-tip__eyebrow {
    font-size: var(--lumo-font-size-xxs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lumo-tertiary-text-color);
}

.sundevs-tip__title {
    font-weight: 600;
    color: var(--lumo-header-text-color);
    line-height: var(--lumo-line-height-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sundevs-tip__text {
    font-size: var(--lumo-font-size-s);
    line-height: var(--lumo-line-height-s);
    color: var(--lumo-secondary-text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sundevs-tip__actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: var(--lumo-space-xs);
}

.sundevs-tip__menu {
    grid-area: menu;
    align-self: start;
    margin-top: calc(var(--lumo-space-xs) * -1);
    color: var(--lumo-secondary-text-color);
}

/* Narrow: the buttons move under the text; the height is still fixed. */
@container (max-width: 560px) {
    .sundevs-tip__inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "icon body menu"
            ". actions actions";
        align-items: start;
        row-gap: var(--lumo-space-s);
        height: 10.5rem;
        padding-left: var(--lumo-space-m);
    }
}

/* Tabs keep their whole label: on a narrow screen the tab row scrolls sideways instead of squeezing every tab
   until its text is cut off (Settings and Integrations have up to eight tabs) */
vaadin-tabs > vaadin-tab {
    flex-shrink: 0;
}

/* License key design (Settings → License keys, product form): patterns and codes in the monospace face */
vaadin-text-field.key-mono > input {
    font-family: var(--lumo-font-family-mono, monospace);
}

/* ── Colours: Star Pass as designed ───────────────────────────────────────────────────────────────────────────────
   Primary buttons and ticked boxes are ink, and the blue accent marks focus, links and selection (starpass/tokens.css).
   The current menu item uses Star Pass's own glass highlight. An owner's colour from Settings › Branding
   (BrandingService.accentCss) still outranks this with html:root. */

/* ── Page layout tokens (1.4.0) ──────────────────────────────────────────────────────────────────────────────────
   One padding and width for every admin page, so moving between pages doesn't shift the content. Pages opt in with
   the sun-page class (narrow form pages add sun-page--narrow); tab rows with sun-tabs. */
html {
    --sun-page-pad-x: var(--lumo-space-l);
    --sun-page-pad-top: var(--lumo-space-m);
    --sun-page-pad-bottom: var(--lumo-space-xl);
    --sun-page-max: 1280px;
    --sun-content-max: 960px;
    --sun-card-gap: var(--lumo-space-l);
    --sun-card-pad: var(--lumo-space-l);
}

@media (max-width: 720px) {
    html {
        --sun-page-pad-x: var(--lumo-space-s);
        --sun-page-pad-top: var(--lumo-space-s);
        --sun-page-pad-bottom: var(--lumo-space-l);
        --sun-card-gap: var(--lumo-space-m);
        --sun-card-pad: var(--lumo-space-m);
    }
}

.sun-page {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--sun-page-max);
    padding: var(--sun-page-pad-top) var(--sun-page-pad-x) var(--sun-page-pad-bottom);
}

.sun-page--narrow {
    max-width: calc(var(--sun-content-max) + 2 * var(--sun-page-pad-x));
}

/* a column of cards with the standard gap */
.sun-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sun-card-gap);
    width: 100%;
    box-sizing: border-box;
}

.sun-card {
    display: flex;
    flex-direction: column;
    gap: var(--lumo-space-m);
    box-sizing: border-box;
    width: 100%;
    padding: var(--sun-card-pad);
    background: var(--lumo-base-color);
    border: 1px solid var(--lumo-contrast-10pct);
    border-radius: var(--lumo-border-radius-l);
}

.sun-card__title {
    margin: 0;
    font-size: var(--lumo-font-size-l);
}

/* tab rows: each tab as wide as its label (with a common minimum), left-aligned, instead of stretching */
vaadin-tabsheet.sun-tabs > vaadin-tabs,
vaadin-tabs.sun-tabs {
    align-self: flex-start;
    max-width: 100%;
}

vaadin-tabsheet.sun-tabs > vaadin-tabs > vaadin-tab,
vaadin-tabs.sun-tabs > vaadin-tab {
    flex: 0 0 auto;
    min-width: 8rem;
    justify-content: center;
}

vaadin-tabsheet.sun-tabs::part(tabs-container) {
    padding: 0 0 var(--lumo-space-m);
}

/* ── Small shared pieces ─────────────────────────────────────────────────────────────────────────────────────── */

/* a one-line note: secondary text, never red (for "still being tried out", privacy lines, the version) */
.sun-muted-note {
    margin: 0;
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    line-height: var(--lumo-line-height-s);
}

.sun-muted-note a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* an empty list in one line, not a tall empty table */
.sun-empty-compact {
    margin: 0;
    padding: var(--lumo-space-m);
    border: 1px dashed var(--lumo-contrast-20pct);
    border-radius: var(--lumo-border-radius-m);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
    text-align: center;
}

/* a link that opens another site */
.sun-link-external {
    display: inline-flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    font-weight: 600;
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-body-text-color);
}

.sun-link-external::after {
    content: "↗";
    color: var(--lumo-secondary-text-color);
}

/* SecretField: a token or key as "…4F2A" with a copy button, or in full once */
.sun-secret {
    display: inline-flex;
    align-items: center;
    gap: var(--lumo-space-xs);
    min-width: 0;
    max-width: 100%;
}

.sun-secret__value {
    font-family: var(--lumo-font-family-mono, ui-monospace, monospace);
    font-size: var(--lumo-font-size-s);
    color: var(--lumo-body-text-color);
    white-space: nowrap;
}

.sun-secret--full {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    padding: var(--lumo-space-s) var(--lumo-space-s) var(--lumo-space-s) var(--lumo-space-m);
    background: var(--lumo-contrast-5pct);
    border: 1px solid var(--vaadin-input-field-border-color);
    border-radius: var(--lumo-border-radius-m);
}

.sun-secret--full .sun-secret__value {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    word-break: break-all;
    user-select: all;
}

.sun-secret--full .sun-secret__copy {
    flex: none;
}

/* text inside a plain dialog body */
.sun-dialog-text {
    margin: 0 0 var(--lumo-space-m);
    color: var(--lumo-secondary-text-color);
    font-size: var(--lumo-font-size-s);
}

/* ── Fields: a visible edge in both themes ───────────────────────────────────────────────────────────────────────
   WCAG asks 3:1 for a field's boundary. Light keeps a soft but clearer line; dark gets a solid mid-grey line
   (≥3:1 against the page and the cards) on a slightly sunken background. */
html {
    --vaadin-input-field-border-color: hsl(220 14% 60%);
}

html[theme~=dark] {
    --vaadin-input-field-border-color: hsl(220 12% 46%);
    --vaadin-input-field-background: hsl(220 25% 6% / 0.55);
}

html[theme~=dark] :is(vaadin-text-field, vaadin-password-field, vaadin-combo-box, vaadin-multi-select-combo-box,
    vaadin-date-picker, vaadin-time-picker, vaadin-select, vaadin-number-field, vaadin-integer-field,
    vaadin-email-field, vaadin-text-area, vaadin-big-decimal-field, vaadin-date-time-picker)[readonly]::part(input-field) {
    border-style: dashed;
}

html[theme~=dark] vaadin-checkbox::part(checkbox),
html[theme~=dark] vaadin-radio-button::part(radio) {
    box-shadow: inset 0 0 0 1px var(--vaadin-input-field-border-color);
}

html[theme~=dark] vaadin-checkbox[checked]::part(checkbox),
html[theme~=dark] vaadin-checkbox[indeterminate]::part(checkbox) {
    box-shadow: none;
}

/* ── Dialogs in dark: a lighter surface with an edge, and a darker backdrop, so a dialog never melts into the page */
html[theme~=dark] :is(vaadin-dialog-overlay, vaadin-confirm-dialog-overlay)::part(overlay) {
    background: hsl(220 18% 15%);
    box-shadow: inset 0 0 0 1px hsl(220 14% 26%), 0 16px 48px hsl(0 0% 0% / 0.6);
}

html[theme~=dark] :is(vaadin-dialog-overlay, vaadin-confirm-dialog-overlay)::part(backdrop) {
    background: hsl(220 30% 2% / 0.72);
}

html:not([theme~=dark]) :is(vaadin-dialog-overlay, vaadin-confirm-dialog-overlay)::part(backdrop) {
    background: hsl(220 30% 20% / 0.32);
}

/* menus, drop-downs and pickers in dark: the same lighter surface */
html[theme~=dark] :is(vaadin-select-overlay, vaadin-combo-box-overlay, vaadin-multi-select-combo-box-overlay,
    vaadin-context-menu-overlay, vaadin-menu-bar-overlay, vaadin-date-picker-overlay)::part(overlay) {
    background: hsl(220 18% 15%);
    box-shadow: inset 0 0 0 1px hsl(220 14% 26%), 0 8px 24px hsl(0 0% 0% / 0.5);
}

/* "Learn more" links to the docs (components/Docs) */
a.docs-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: var(--lumo-font-size-s);
    font-weight: 500;
    color: var(--lumo-secondary-text-color);
    text-decoration: none;
    white-space: nowrap;
}

a.docs-link:hover {
    color: var(--lumo-header-text-color);
    text-decoration: underline;
}

a.docs-link vaadin-icon {
    width: 0.85em;
    height: 0.85em;
}
