/* WX Portal frontend styles. Themes override via CSS variables. */
:root {
  --wx-primary: #2563eb;
  --wx-primary-contrast: #ffffff;
  --wx-text: #111827;
  --wx-muted: #6b7280;
  --wx-border: #e5e7eb;
  --wx-bg: #ffffff;
  --wx-bg-soft: #f9fafb;
  --wx-success: #15803d;
  --wx-error: #b91c1c;
  --wx-live: #dc2626;
  --wx-radius: 8px;
}

/* Buttons & notices */
.wx-button { display: inline-block; padding: .6em 1.2em; border-radius: var(--wx-radius); border: 1px solid var(--wx-border); background: var(--wx-bg); color: var(--wx-text); text-decoration: none; font: inherit; cursor: pointer; line-height: 1.3; }
.wx-button:hover { background: var(--wx-bg-soft); }
.wx-button--primary { background: var(--wx-primary); border-color: var(--wx-primary); color: var(--wx-primary-contrast); }
.wx-button--primary:hover { filter: brightness(.95); background: var(--wx-primary); }
.wx-button--large { padding: .9em 1.8em; font-size: 1.1em; }
.wx-button[disabled] { opacity: .6; cursor: default; }
.wx-link-button { background: none; border: 0; padding: 0; color: var(--wx-muted); text-decoration: underline; cursor: pointer; font: inherit; }
.wx-notice { border: 1px solid var(--wx-border); border-radius: var(--wx-radius); padding: .8rem 1rem; background: var(--wx-bg-soft); color: var(--wx-text); }
.wx-notice--error { border-color: var(--wx-error); color: var(--wx-error); }
.wx-badge { display: inline-block; padding: .2em .7em; border-radius: 999px; background: var(--wx-bg-soft); border: 1px solid var(--wx-border); color: var(--wx-muted); font-size: .8em; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.wx-badge--live { background: var(--wx-live); border-color: var(--wx-live); color: #fff; }
.wx-message { margin: .75rem 0 0; font-size: .95em; }
.wx-message--error { color: var(--wx-error); }
.wx-message--success { color: var(--wx-success); }

/* Locked content (Members) */
.wx-locked { border: 1px solid var(--wx-border); border-radius: var(--wx-radius); padding: 1.5rem; background: var(--wx-bg-soft); }
.wx-locked__teaser { position: relative; max-height: 12rem; overflow: hidden; margin-bottom: 1rem; }
.wx-locked__teaser::after { content: ""; position: absolute; inset: auto 0 0 0; height: 6rem; background: linear-gradient(transparent, var(--wx-bg-soft)); }

/* Session page */
.wx-session { margin: 2rem 0; display: grid; gap: 1.5rem; }
.wx-session__when { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; }
.wx-session__tz, .wx-session__duration { color: var(--wx-muted); font-size: .9em; }
.wx-session__host { border: 1px dashed var(--wx-border); border-radius: var(--wx-radius); padding: 1rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.wx-session__host p { margin: 0; }
.wx-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex: 1 1 320px; }
.wx-share span { color: var(--wx-muted); font-size: .9em; }
.wx-share input { flex: 1 1 200px; min-width: 0; padding: .5em .7em; border: 1px solid var(--wx-border); border-radius: var(--wx-radius); font: inherit; }
.wx-session__hint { color: var(--wx-muted); font-size: .95em; }

/* Countdown */
.wx-countdown { display: flex; gap: 1rem; flex-wrap: wrap; }
.wx-countdown__item { min-width: 72px; text-align: center; padding: .8rem .6rem; border: 1px solid var(--wx-border); border-radius: var(--wx-radius); background: var(--wx-bg-soft); }
.wx-countdown__value { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wx-countdown__label { display: block; color: var(--wx-muted); font-size: .8em; text-transform: uppercase; letter-spacing: .05em; margin-top: .25rem; }

/* Live embed */
.wx-live-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--wx-radius); overflow: hidden; }
.wx-live-embed iframe, .wx-live-embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wx-live__hint { color: var(--wx-muted); font-size: .9em; margin: .5rem 0 0; }
.wx-recording__video { width: 100%; max-height: 70vh; border-radius: var(--wx-radius); background: #000; }

/* Forms */
.wx-form { border: 1px solid var(--wx-border); border-radius: var(--wx-radius); padding: 1.25rem; background: var(--wx-bg); max-width: 520px; }
.wx-form__title { margin: 0 0 .5rem; }
.wx-form__hint { color: var(--wx-muted); margin: 0 0 1rem; }
.wx-field { margin: 0 0 1rem; }
.wx-field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.wx-field input[type="text"], .wx-field input[type="email"], .wx-field input[type="password"] { width: 100%; padding: .6em .8em; border: 1px solid var(--wx-border); border-radius: var(--wx-radius); font: inherit; box-sizing: border-box; }
.wx-field--checkbox label { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
.wx-field--hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wx-field--submit { margin-bottom: 0; }
.wx-registered { border: 1px solid var(--wx-border); border-left: 4px solid var(--wx-success); border-radius: var(--wx-radius); padding: 1rem 1.25rem; background: var(--wx-bg-soft); }
.wx-registered__links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin: .75rem 0 0; }

/* Lists & cards */
.wx-cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.wx-card { border: 1px solid var(--wx-border); border-radius: var(--wx-radius); overflow: hidden; background: var(--wx-bg); display: flex; flex-direction: column; }
.wx-card__media img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.wx-card__body { padding: 1rem 1.25rem 1.25rem; display: grid; gap: .5rem; align-content: start; }
.wx-card__title { margin: 0; font-size: 1.15em; }
.wx-card__title a { text-decoration: none; color: inherit; }
.wx-card__when { margin: 0; color: var(--wx-muted); }
.wx-card__excerpt { margin: 0; }
.wx-my-sessions__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.wx-my-sessions__item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid var(--wx-border); border-radius: var(--wx-radius); padding: .9rem 1.1rem; background: var(--wx-bg); }
.wx-my-sessions__item--open { border-color: var(--wx-live); }
.wx-my-sessions__type { color: var(--wx-muted); font-size: .85em; margin-left: .5rem; }
.wx-my-sessions__title { margin: .3rem 0 .15rem; font-size: 1.05em; }
.wx-my-sessions__title a { text-decoration: none; color: inherit; }
.wx-my-sessions__when { margin: 0; color: var(--wx-muted); font-size: .95em; }

@media (max-width: 600px) {
  .wx-countdown__item { min-width: 60px; padding: .6rem .4rem; }
  .wx-countdown__value { font-size: 1.5rem; }
  .wx-my-sessions__item { flex-direction: column; align-items: flex-start; }
}

/* Portal (Members) */
.wx-portal { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; margin: 2rem 0; }
.wx-portal--guest { display: block; }
.wx-portal__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.wx-portal__nav a { display: block; padding: .55em .9em; border-radius: var(--wx-radius); color: var(--wx-text); text-decoration: none; }
.wx-portal__nav a:hover { background: var(--wx-bg-soft); }
.wx-portal__nav a.is-active { background: var(--wx-primary); color: var(--wx-primary-contrast); }
.wx-portal__nav .wx-portal__logout { color: var(--wx-muted); }
.wx-portal__user { margin: 0 0 .75rem; padding: 0 .9em; font-weight: 600; color: var(--wx-muted); font-size: .9em; }
.wx-portal__section { margin: 0 0 2rem; }
.wx-portal__section-title { margin: 0 0 .75rem; font-size: 1.3em; }
.wx-portal__level { margin: 0 0 .75rem; }
.wx-form__links { margin: 1rem 0 0; font-size: .95em; color: var(--wx-muted); }
.wx-field__hint { display: block; color: var(--wx-muted); font-size: .85em; margin-top: .3rem; }
.wx-notice--success { border-color: var(--wx-success); color: var(--wx-success); }
@media (max-width: 720px) {
  .wx-portal { grid-template-columns: 1fr; gap: 1rem; }
  .wx-portal__nav ul { flex-direction: row; flex-wrap: wrap; }
}
