/* The self-service parts of Atlas Web (ClaudeOS#1326): the trial quota in
   the header, the notices at 50/80/100 %, the activation page and the
   welcome after the first login. Every rule is scoped to an element only
   trial_ui.js or welcome_ui.js creates, so an instance without the AI
   gateway renders exactly as before. */

/* --- the quota in the header -------------------------------------------- */

.trial-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-elevated) 75%, transparent);
  font-size: 0.8rem;
  line-height: 1.25;
}

.trial-status-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trial-status-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.trial-status-value {
  font-weight: 600;
  white-space: nowrap;
}

.trial-status-meter {
  position: relative;
  flex: 1 1 4rem;
  min-width: 3.5rem;
  height: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  overflow: hidden;
}

.trial-status-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--ok);
}

.trial-status[data-level="notice"] .trial-status-fill,
.trial-status[data-level="warning"] .trial-status-fill {
  background: var(--ask);
}

.trial-status[data-level="locked"] {
  border-color: color-mix(in srgb, var(--ask) 40%, var(--line));
}

.trial-status .trial-activate {
  white-space: nowrap;
}

/* In the sidebar: one column at its foot, above «Einrichten». */
.top .trial-status {
  flex-direction: column;
  align-items: stretch;
  margin: 0 0.35rem 0.5rem;
}

.top .trial-status .trial-status-meter {
  flex: none;
  width: 100%;
}

.top .trial-status .label-short {
  display: none;
}

/* The narrow rail (app.css swaps every .label-long for .label-short there):
   the percentage, the bar and «Aktivieren», centred like the icons. */
@media (min-width: 821px) and (max-width: 1180px) {
  .top .trial-status {
    align-items: center;
    gap: 0.3rem;
    margin: 0 0.2rem 0.5rem;
    padding: 0.4rem 0.2rem;
    text-align: center;
    font-size: 0.72rem;
  }

  .top .trial-status .label-short {
    display: block;
  }

  .top .trial-status .trial-activate {
    width: 100%;
    min-height: 0;
    padding: 0.3rem 0.2rem;
    font-size: 0.68rem;
  }
}

/* The Overview's own line is for a phone only: there the sidebar's tools
   are hidden (app.css, max-width 820px), and with them the quota. */
#trial-status-phone {
  display: none;
}

@media (max-width: 820px) {
  #trial-status-phone {
    display: flex;
    margin: 0 0 0.9rem;
  }
}

/* --- the notice on the Overview ----------------------------------------- */

.trial-notice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
  margin: 0 0 1.15rem;
  padding: 0.9rem 2.6rem 0.9rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--ask) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ask) 7%, var(--bg-elevated));
}

.trial-notice[data-level="100"] {
  padding-right: 1.05rem;
  border-color: color-mix(in srgb, var(--ask) 50%, var(--line));
  background: color-mix(in srgb, var(--ask) 12%, var(--bg-elevated));
}

.trial-notice-text {
  flex: 1 1 22rem;
  min-width: min(100%, 18rem);
}

.trial-notice h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.trial-notice-body {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.trial-notice-dismiss {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
}

/* --- the activation page ------------------------------------------------ */

.trial-dialog {
  width: min(36rem, calc(100vw - 2rem));
}

.trial-dialog form,
.trial-done {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* The confirmation replaces the form, so it brings the form's own padding
   (app.css `dialog form`). */
.trial-done {
  padding: 1.4rem 1.45rem 1.25rem;
}

.trial-done p {
  margin: 0;
}

.trial-done .btn {
  align-self: flex-end;
}

html[data-ui-style="glass"] .trial-done {
  padding: 1.7rem 1.7rem 1.4rem;
}

.trial-dialog h2 {
  margin: 0;
}

.trial-dialog .hint {
  margin: 0;
}

.trial-plan {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
}

.trial-total {
  margin: -0.2rem 0 0;
  font-weight: 600;
}

.trial-billing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.75rem;
  margin: 0;
  padding: 0.75rem 0.85rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.trial-billing legend {
  padding: 0 0.3rem;
  font-weight: 600;
}

.trial-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

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

.trial-terms {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.55rem;
}

.trial-terms input {
  flex: none;
  width: auto;
  margin-top: 0.2rem;
}

.trial-terms-link {
  margin: -0.35rem 0 0 1.6rem;
  font-size: 0.85rem;
}

.trial-dialog-note {
  margin: 0;
}

@media (max-width: 560px) {
  .trial-billing {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The ask card's «Atlas aktivieren»: the one answer that matters, marked
   the way «Secret einrichten» is (app.css), in the accent. */
.ask-option.ask-activate {
  font-weight: 600;
  border-color: var(--accent);
}

/* --- the welcome after the first login ---------------------------------- */

.home-welcome {
  position: relative;
  margin: 0 0 1.15rem;
  padding: 1rem 2.6rem 1.05rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}

.home-welcome-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-welcome-intro {
  margin: 0.3rem 0 0.85rem;
  color: var(--muted);
}

.home-welcome-dismiss {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.home-welcome-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem 1.5rem;
}

.home-welcome h4 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.home-welcome-notes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.home-welcome-notes li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.home-welcome-scope {
  flex: none;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 45%, transparent);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.home-welcome-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.home-welcome-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.home-welcome-task:hover,
.home-welcome-task:focus-visible {
  border-color: var(--accent);
}

.home-welcome-task.is-started {
  color: var(--muted);
}

.home-welcome-task-done {
  flex: none;
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 600;
}

.home-welcome-error {
  margin: 0.6rem 0 0;
}
