/* Unimar Appstore — glass components: panels, buttons, inputs, progress, chips,
   stars, dialogs ("Aero" windows), menus, toasts, skeletons. */

/* ---------- Glass panels ---------- */
.panel {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--r-win);
  background: var(--panel-gloss), var(--panel);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--panel-edge-out);
  box-shadow: inset 0 0 0 1px var(--panel-edge-in), var(--panel-shadow);
}
.panel-tight { padding: 12px 14px; }
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-head .more { margin-left: auto; font-size: 12px; display: inline-flex; align-items: center; gap: 2px; }
.panel-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

/* An "inset well" inside a panel (forms, code, license text) */
.well {
  border-radius: var(--r-card);
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--divider);
  box-shadow: inset 0 1px 3px rgba(10, 40, 80, .10);
  padding: 12px 14px;
}
:root[data-theme="dark"] .well { background: rgba(0, 0, 0, .22); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .well { background: rgba(0, 0, 0, .22); } }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 14px;
  border-radius: var(--r-btn);
  border: 1px solid var(--btn-edge);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none !important;
  user-select: none;
  isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), 0 1px 1px rgba(10, 40, 80, .08);
  transition: background .15s, border-color .15s, box-shadow .2s, color .15s;
}
.btn::before { /* top-half gloss */
  content: "";
  position: absolute;
  inset: 1px 1px 50% 1px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, .12));
  pointer-events: none;
  z-index: -1;
}
.btn:hover {
  background: var(--btn-hover-bg);
  border-color: var(--btn-hover-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 0 7px 1px rgba(127, 208, 255, .75);
}
.btn:active, .btn.is-pressed {
  background: var(--btn-active-bg);
  box-shadow: inset 0 2px 4px rgba(10, 50, 90, .30);
}
.btn:active::before { opacity: .35; }
.btn[disabled], .btn.is-disabled {
  opacity: .55;
  cursor: default;
  pointer-events: none;
  filter: saturate(.4);
}
.btn .i { margin-left: -2px; }

.btn-primary {
  color: #fff;
  border-color: #17589a;
  background: linear-gradient(#4aa8ec, #1f74c0);
  text-shadow: 0 -1px 0 rgba(0, 30, 70, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 2px rgba(10, 50, 100, .30);
}
.btn-primary::before { background: linear-gradient(rgba(255, 255, 255, .50), rgba(255, 255, 255, .10)); }
.btn-primary:hover {
  color: #fff;
  border-color: #1a64ad;
  background: linear-gradient(#64b9f3, #2a86d2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 9px 2px rgba(127, 208, 255, .85);
}
.btn-primary:active { background: linear-gradient(#1f74c0, #2d8ad8); box-shadow: inset 0 2px 5px rgba(0, 20, 60, .45); }

.btn-teal {
  color: #fff;
  border-color: #0e7c71;
  background: linear-gradient(#3fd0c0, #14988b);
  text-shadow: 0 -1px 0 rgba(0, 50, 45, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 2px rgba(0, 70, 60, .30);
}
.btn-teal::before { background: linear-gradient(rgba(255, 255, 255, .50), rgba(255, 255, 255, .10)); }
.btn-teal:hover {
  color: #fff;
  border-color: #0e8a7e;
  background: linear-gradient(#5be0d1, #1aab9d);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 9px 2px rgba(80, 230, 210, .7);
}
.btn-teal:active { background: linear-gradient(#14988b, #23b3a5); box-shadow: inset 0 2px 5px rgba(0, 40, 35, .45); }

.btn-danger:hover {
  color: #fff;
  border-color: #a92b2b;
  background: linear-gradient(#ef7a6a, #c43a2a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 0 9px 2px rgba(255, 120, 100, .65);
}
.btn-danger-solid {
  color: #fff;
  border-color: #9c2a1c;
  background: linear-gradient(#e8604c, #b52a1a);
  text-shadow: 0 -1px 0 rgba(60, 0, 0, .35);
}
.btn-danger-solid::before { background: linear-gradient(rgba(255, 255, 255, .45), rgba(255, 255, 255, .08)); }
.btn-danger-solid:hover { color: #fff; border-color: #9c2a1c; background: linear-gradient(#f07462, #c43a2a); box-shadow: 0 0 9px 2px rgba(255, 120, 100, .65); }

/* Translucent "on glass" buttons for the hero / dark imagery */
.btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .55);
  background: linear-gradient(rgba(255, 255, 255, .22), rgba(255, 255, 255, .06));
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 3px rgba(0, 0, 0, .2);
}
.btn-ghost:hover { color: #fff; background: linear-gradient(rgba(255, 255, 255, .34), rgba(255, 255, 255, .12)); border-color: rgba(255, 255, 255, .85); }

.btn-sm { min-height: 26px; padding: 2px 11px; font-size: 12px; }
.btn-lg { min-height: 36px; padding: 6px 22px; font-size: 14px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: 30px; min-width: 30px; }
.btn-icon.btn-sm { width: 26px; min-width: 26px; }

.btn-link {
  background: none; border: 0; padding: 0;
  color: var(--link); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- Inputs ---------- */
.input, .select, .textarea {
  width: 100%;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: var(--r-input);
  border: 1px solid var(--input-edge);
  background: var(--input-bg);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(10, 40, 80, .14);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: #5f9fd0; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(10, 40, 80, .12), 0 0 0 3px rgba(127, 208, 255, .45);
}
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6878' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(#fdfefe, #e8eff6);
  background-repeat: no-repeat;
  background-position: right 9px center, 0 0;
  background-size: 10px 7px, auto;
  cursor: pointer;
}
:root[data-theme="dark"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b8c8da' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.04)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b8c8da' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.04)); } }
.select option { color: #1a2330; background: #fff; }
.field { display: grid; gap: 4px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 1em; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  line-height: 20px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-edge);
  color: inherit;
  white-space: nowrap;
}
a.chip:hover { text-decoration: none; background: var(--hover-bg); border-color: var(--btn-hover-edge); }
.chip-teal { background: rgba(31, 181, 166, .14); border-color: rgba(31, 181, 166, .4); }
.chip-warn { background: rgba(224, 160, 32, .16); border-color: rgba(224, 160, 32, .45); }
.chip-danger { background: rgba(214, 69, 69, .14); border-color: rgba(214, 69, 69, .4); }

.badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px; font-weight: 700;
  color: #fff;
  background: linear-gradient(#ff8a70, #d8402c);
  border: 1px solid rgba(120, 20, 10, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 6px rgba(255, 120, 90, .55);
  text-shadow: none;
}

.verified { color: var(--accent); display: inline-flex; vertical-align: -3px; }
.verified .i { width: 15px; height: 15px; }

/* ---------- Stars ---------- */
.stars { position: relative; display: inline-block; line-height: 0; vertical-align: -2px; }
.stars .i { width: 13px; height: 13px; }
.stars-bg { color: rgba(110, 135, 160, .35); white-space: nowrap; }
.stars-fg { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--star); filter: drop-shadow(0 0 1px rgba(180, 100, 0, .35)); }
.stars-lg .i { width: 18px; height: 18px; }
.rating { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }

/* ---------- Progress ---------- */
.prog {
  position: relative;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: linear-gradient(rgba(0, 20, 40, .14), rgba(0, 20, 40, .06));
  border: 1px solid rgba(20, 60, 100, .35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18), 0 1px 0 rgba(255, 255, 255, .5);
}
.prog-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(#5fd6c8, #1fb5a6 50%, #179a8e 51%, #29c2b2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 0 6px rgba(80, 230, 210, .55);
  transition: width .35s var(--ease);
  overflow: hidden;
}
.prog-bar::after { /* moving sheen */
  content: "";
  position: absolute;
  inset: 0;
  width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  animation: sheen 1.6s linear infinite;
}
@keyframes sheen { from { transform: translateX(-60px); } to { transform: translateX(600px); } }
.prog.is-indeterminate .prog-bar { width: 35% !important; animation: indet 1.3s var(--ease) infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }
.prog-lg { height: 14px; border-radius: 7px; }
.prog-text { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; margin-top: 4px; color: var(--text-dim); }
.prog-text .prog-stage { color: var(--text); font-weight: 500; }
.prog-msg { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Spinner ---------- */
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(42, 138, 212, .25);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Skeletons ---------- */
.sk {
  position: relative;
  overflow: hidden;
  background: var(--skeleton);
  border-radius: 4px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 10px; margin: 6px 0; }
.sk-title { height: 16px; width: 60%; }
.sk-icon { border-radius: 14px; }

/* ---------- Empty / error states ---------- */
.state {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 42px 20px;
}
.state-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(#7cc2f2, #2a7cc4);
  border: 1px solid rgba(10, 60, 110, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 18px -6px rgba(20, 80, 140, .6);
  position: relative;
  overflow: hidden;
}
.state-icon::before { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.1)); }
.state-icon .i { width: 30px; height: 30px; position: relative; }
.state-icon.is-error { background: linear-gradient(#f39a86, #c9442f); border-color: rgba(110, 20, 10, .5); }
.state-icon.is-warn { background: linear-gradient(#f7cf6a, #d6921a); border-color: rgba(110, 70, 0, .5); }
.state h2 { font-size: 18px; }
.state p { color: var(--text-dim); max-width: 460px; margin: 0; }
.state .row { margin-top: 8px; justify-content: center; }

/* ---------- Dialogs: glass "windows" with a caption bar ---------- */
dialog.win {
  padding: 0;
  border: 1px solid var(--glass-border-out);
  border-radius: var(--r-win);
  background: var(--caption-gloss), rgba(46, 110, 170, .62);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 0 0 1px var(--glass-border-in), 0 24px 60px -12px rgba(0, 20, 50, .65), 0 0 0 1px rgba(255, 255, 255, .08);
  color: var(--text);
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow: visible;
}
dialog.win[open] { display: flex; flex-direction: column; animation: winIn .22s var(--ease); }
@keyframes winIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
dialog.win::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.win-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 14px;
  min-height: 36px;
  color: #0b1f33;
  font-weight: 600;
  text-shadow: 0 0 9px #fff, 0 0 3px #fff;
}
.win-caption .win-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-close {
  width: 44px; height: 20px;
  border-radius: 4px;
  border: 1px solid #7a1f12;
  background: linear-gradient(#f08c7c, #e8604c 45%, #c23a28 50%, #b52a1a);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(255, 255, 255, .2);
  transition: box-shadow .15s, background .15s;
}
.win-close .i { width: 12px; height: 12px; stroke-width: 2.6; filter: drop-shadow(0 1px 0 rgba(80, 0, 0, .6)); }
.win-close:hover { background: linear-gradient(#ffa696, #f2705b 45%, #d4432f 50%, #c8331f); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 0 10px 3px rgba(255, 110, 80, .75); }
.win-body {
  margin: 0 7px 7px;
  padding: 18px 20px;
  border-radius: 4px;
  background: var(--panel-strong);
  border: 1px solid rgba(0, 30, 60, .35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
  overflow: auto;
  min-height: 0;
}
.win-body p:last-child { margin-bottom: 0; }
.win-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
:root[data-theme="dark"] dialog.win { background: var(--caption-gloss), rgba(16, 28, 44, .78); }
:root[data-theme="dark"] .win-caption { color: #f1f7ff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) dialog.win { background: var(--caption-gloss), rgba(16, 28, 44, .78); }
  :root:not([data-theme="light"]) .win-caption { color: #f1f7ff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
}
.license-text {
  white-space: pre-wrap;
  font: 12px/1.55 var(--mono);
  max-height: 55vh;
  overflow: auto;
  margin: 0;
}

/* ---------- Dropdown menu ---------- */
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 250px;
  padding: 6px;
  border-radius: var(--r-card);
  background: var(--panel-gloss), var(--panel-strong);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--panel-edge-out);
  box-shadow: inset 0 0 0 1px var(--panel-edge-in), 0 16px 40px -10px rgba(0, 20, 50, .55);
  color: var(--text);
  text-shadow: none;
  z-index: 60;
  animation: winIn .16s var(--ease);
}
.menu[hidden] { display: none; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); padding: 8px 10px 4px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none !important;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--hover-bg); border-color: var(--hover-edge); outline: none; box-shadow: none; }
.menu-item[aria-checked="true"] { background: var(--sel-bg); border-color: var(--sel-edge); }
.menu-item .check { margin-left: auto; opacity: 0; color: var(--accent); }
.menu-item[aria-checked="true"] .check { opacity: 1; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--divider); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 90;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-card);
  background: var(--panel-gloss), var(--panel-strong);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid var(--panel-edge-out);
  box-shadow: inset 0 0 0 1px var(--panel-edge-in), 0 14px 34px -10px rgba(0, 20, 50, .55);
  animation: toastIn .28s var(--ease);
}
.toast.is-leaving { animation: toastOut .2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
.toast-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(#64b9f3, #1f74c0); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
.toast-ico .i { width: 15px; height: 15px; stroke-width: 2.3; }
.toast.is-error .toast-ico { background: linear-gradient(#f08c7c, #c43a2a); }
.toast.is-success .toast-ico { background: linear-gradient(#5be0d1, #14988b); }
.toast.is-warn .toast-ico { background: linear-gradient(#f5cd6a, #d08c12); }
.toast-title { font-weight: 600; }
.toast-msg { color: var(--text-dim); font-size: 12px; word-break: break-word; }
.toast-actions { margin-top: 8px; display: flex; gap: 6px; }
.toast-x { background: none; border: 0; padding: 2px; cursor: pointer; color: var(--text-dim); border-radius: 3px; }
.toast-x:hover { color: var(--text); background: var(--hover-bg); }

/* ---------- Tooltips-lite ---------- */
[data-tip] { position: relative; }
