/* allskyhub base styles (packages/design, Apache-2.0): the night sky behind everything,
   cards, buttons, inputs, navigation, badges. Needs tokens.css first. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: transparent; color: var(--text); font: 16px/1.55 var(--body);
       position: relative; overflow-x: hidden; }

/* The sky: aurora glow and two star layers, fixed behind everything. */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(ellipse 80% 45% at 15% -5%, rgba(79, 227, 176, .22), transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 0%, rgba(180, 140, 255, .24), transparent 60%),
    radial-gradient(ellipse 120% 60% at 50% 110%, rgba(40, 70, 170, .35), transparent 65%),
    url("stars.svg") 0 0 / 700px 700px,
    linear-gradient(180deg, #060a1c 0%, #04060f 55%, #02030a 100%);
}
body::after {
  background: url("stars-bright.svg") 200px 80px / 1100px 1100px;
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }

main { max-width: 64rem; margin: 0 auto; padding: 28px 16px 48px; display: grid; gap: 24px; }
main > * { min-width: 0; }
h1, h2 { margin: 0; line-height: 1.15; font-family: var(--display); }
h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 700; letter-spacing: -0.8px;
     background: var(--sheen); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: #a9c1ff; }
[hidden] { display: none !important; }
::selection { background: rgba(180, 140, 255, .4); }

.appbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; position: sticky; top: 0; z-index: 5;
          background: rgba(4, 6, 15, .55); border-bottom: 1px solid var(--line);
          -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none;
         font-family: var(--display); font-weight: 700; font-size: 21px; letter-spacing: -0.4px; }
.brand img { filter: drop-shadow(0 0 8px rgba(122, 162, 247, .7)); }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-link { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 999px;
            color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 15px; border: 1px solid transparent;
            background: none; box-shadow: none; transition: color .15s, background .15s, border-color .15s; }
.nav-link svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { color: var(--text); background: rgba(122, 162, 247, .1); transform: none; filter: none; box-shadow: none; }
.nav-link.active { color: var(--text); border-color: rgba(122, 162, 247, .45);
                   background: linear-gradient(110deg, rgba(143, 227, 255, .14), rgba(180, 140, 255, .18));
                   box-shadow: 0 0 24px -6px rgba(122, 162, 247, .6), inset 0 1px 0 rgba(255, 255, 255, .08); }
button.nav-link { color: var(--text-2); padding: 0 11px; }
button.nav-link:hover { color: var(--danger); background: rgba(255, 122, 147, .1); }
@media (max-width: 30rem) { .nav-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .nav-link { padding: 0 11px; } .appbar { padding: 8px 12px; } }
/* Signed in, the menu has up to six icons: on a phone only the logo stays of the brand,
   its name still read out. */
@media (max-width: 30rem) {
  .appbar:has(.nav-out) { gap: 4px; }
  .appbar:has(.nav-out) .appbar-end { gap: 0; }
  .appbar:has(.nav-out) .nav-link { padding: 0 9px; }
  .appbar:has(.nav-out) .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.muted { color: var(--text-2); font-size: .94em; }
.stack { display: grid; gap: 14px; }
.inline { display: inline; }
.card { padding: 20px; border-radius: var(--radius); display: grid; gap: 12px; align-content: start; position: relative;
        background: linear-gradient(160deg, rgba(30, 42, 82, .55), rgba(12, 17, 36, .7));
        border: 1px solid var(--line); box-shadow: var(--glow);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
                background: linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 40%); }
.empty { text-align: center; padding: 40px 20px; justify-items: center; }

label { display: grid; gap: 6px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
                background: rgba(6, 10, 24, .6); color: var(--text); font: inherit;
                transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(122, 162, 247, .2); outline: none; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
                  border-radius: 999px; border: 0; color: var(--accent-ink); font: inherit; font-weight: 700;
                  text-decoration: none; cursor: pointer; letter-spacing: .1px;
                  background: linear-gradient(110deg, #8fe3ff, #7aa2f7 45%, #b48cff);
                  box-shadow: 0 8px 28px -8px rgba(122, 162, 247, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
                  transition: transform .15s, box-shadow .15s, filter .15s; }
button:hover, .button:hover { transform: translateY(-1px); filter: brightness(1.08); color: var(--accent-ink);
                              box-shadow: 0 12px 36px -8px rgba(150, 140, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .35); }
button.link { min-height: 44px; padding: 0 8px; background: none; box-shadow: none; color: var(--accent); font-weight: 600; }
button.link:hover { transform: none; color: #a9c1ff; }

.msg { padding: 12px 16px; border-radius: 12px; border: 1px solid; }
.msg.error { background: rgba(255, 122, 147, .12); color: var(--danger); border-color: rgba(255, 122, 147, .35); }
.msg.ok { background: rgba(79, 227, 176, .12); color: var(--ok); border-color: rgba(79, 227, 176, .35); }

.auth { max-width: 27rem; width: 100%; margin: 4vh auto 0; display: grid; gap: 20px; }
.app-foot { text-align: center; color: var(--text-2); font-size: 13px; padding-top: 16px; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.button.small { min-height: 44px; padding: 0 18px; font-size: 15px; }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.warn { color: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12px;
         font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
         background: rgba(167, 176, 204, .12); color: var(--text-2); border: 1px solid rgba(167, 176, 204, .2); }
.badge.ok { background: rgba(79, 227, 176, .12); color: var(--ok); border-color: rgba(79, 227, 176, .35); }
.badge.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
                    box-shadow: 0 0 0 0 rgba(79, 227, 176, .7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(79, 227, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 227, 176, 0); } }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
code { font-family: ui-monospace, monospace; font-size: .92em; color: #c9d6ff; }
.code { font-family: ui-monospace, monospace; font-size: 26px; letter-spacing: 4px; text-transform: uppercase;
        color: #fff; text-shadow: 0 0 18px rgba(122, 162, 247, .8); }

.lead { font-size: 19px; color: var(--text-2); max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button.secondary, button.secondary { background: rgba(122, 162, 247, .08); color: var(--text); border: 1px solid rgba(122, 162, 247, .45);
                                      box-shadow: none; }
.button.secondary:hover, button.secondary:hover { background: rgba(122, 162, 247, .18); color: var(--text); }
.eyebrow { font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
           color: var(--aurora); }
.card.danger { border-style: dashed; border-color: rgba(255, 122, 147, .35); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; }
button.danger:hover { background: rgba(255, 122, 147, .12); color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 30rem) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
label.check input { flex: none; width: 22px; min-height: 22px; accent-color: var(--accent); }
.list { list-style: none; padding: 0; margin: 0; }
.list.card { display: block; padding: 4px 20px; }
.list > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.small { font-size: 13px; }

/* Red night theme: the sky turns red, pictures and videos too. */
[data-theme="red"] body::before, [data-theme="red"] body::after {
  filter: grayscale(1) sepia(1) saturate(6) hue-rotate(-50deg) brightness(.55);
}
[data-theme="red"] img, [data-theme="red"] video, [data-theme="red"] svg image {
  filter: grayscale(1) sepia(1) saturate(8) hue-rotate(-50deg) brightness(.7);
}
[data-theme="red"] button, [data-theme="red"] .button { box-shadow: none; }
[data-theme="red"] ::selection { background: rgba(255, 40, 40, .4); }
[data-theme="red"] button, [data-theme="red"] .button { background: var(--accent); color: var(--accent-ink); }
[data-theme="red"] .button.secondary, [data-theme="red"] button.secondary,
[data-theme="red"] button.link, [data-theme="red"] .nav-link { background: transparent; color: var(--text); }
[data-theme="red"] .card { background: linear-gradient(160deg, rgba(60, 0, 0, .5), rgba(14, 0, 0, .75)); }
[data-theme="red"] .appbar { background: rgba(0, 0, 0, .7); }
[data-theme="red"] .nav-link.active { border-color: var(--line); background: rgba(255, 40, 40, .12); box-shadow: none; }
[data-theme="red"] input, [data-theme="red"] select, [data-theme="red"] textarea { background: rgba(20, 0, 0, .7); }
[data-theme="red"] code { color: var(--text); }
