/* ── THUGNET — private network. sleek, dark, exclusive. ─────────────────────── */
:root {
  --bg:      #080a0e;
  --bg2:     #0c0f14;
  --panel:   #0e1218;
  --line:    #1b202a;
  --line2:   #283040;
  --cyan:    #2fe0c8;
  --cyan-2:  #63ecda;
  --cyan-dim:#0e332e;
  --red:     #e0533f;
  --dim:     #545c68;
  --dim2:    #78828f;
  --text:    #aab3bf;
  --white:   #eaf0f5;
  --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono:    ui-monospace, "JetBrains Mono", "SF Mono", "Cascadia Code", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  display: flex; flex-direction: column; min-height: 100vh; position: relative;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: var(--cyan); color: #04241f; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Background — a single soft glow behind the mark, over the night scene. */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(46% 40% at 50% 32%, rgba(47,224,200,0.13), transparent 70%),
    radial-gradient(60% 50% at 50% 120%, rgba(47,224,200,0.05), transparent 60%);
}

/* ── Night sky — stars + layered mountain silhouettes, deepest layer ────────── */
.night {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(80% 55% at 50% 82%, rgba(47,224,200,0.06), transparent 60%),
    linear-gradient(180deg, #05070a 0%, #070a0e 55%, #0a0f14 100%);
}
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.stars circle { fill: #d6efe9; }
.stars .tw { opacity: var(--o, .8); animation: twinkle 4.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: var(--o, .8); } 50% { opacity: .16; } }
.ridge { position: absolute; left: 0; bottom: 0; width: 100%; height: clamp(190px, 34vh, 360px); display: block; }
.ridge .m-far  { fill: #0b131a; }
.ridge .m-mid  { fill: #070d13; }
.ridge .m-near { fill: #04070b; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .4px; border: 1px solid transparent;
  border-radius: 4px; padding: 9px 20px; transition: all .15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-solid { background: var(--cyan); color: #042420; border-color: var(--cyan); }
.btn-solid:hover { background: var(--cyan-2); box-shadow: 0 3px 16px rgba(47,224,200,0.2); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line2); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-lg { font-size: 14px; padding: 12px 26px; border-radius: 5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.top {
  position: relative; z-index: 10; display: flex; align-items: center;
  padding: 20px clamp(18px, 5vw, 48px);
}
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 700; letter-spacing: 2px; font-size: 15px; }
.wordmark img { width: 26px; height: 26px; border-radius: 5px; }
.top-auth { margin-left: auto; display: flex; gap: 10px; }

/* ── Hero — everything centered around the mark ──────────────────────────── */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 24px 60px; gap: 4px;
  animation: in .7s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes in { from { opacity: 0; transform: translateY(12px); } }

.status {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono);
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim2);
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pulse 2.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 55% { opacity: .35; } }

.logo-wrap { position: relative; display: inline-grid; place-items: center; padding: 26px; }
.logo-wrap::before {
  content: ""; position: absolute; width: 78%; height: 78%; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,224,200,0.28), transparent 68%);
  filter: blur(26px);
}
.logo {
  position: relative; width: clamp(116px, 22vw, 168px); height: auto;
  filter: drop-shadow(0 0 24px rgba(47,224,200,0.42));
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.brandmark { font-size: clamp(30px, 6.5vw, 50px); font-weight: 800; letter-spacing: 8px; color: var(--white); margin: 14px 0 0 8px; }
.brandmark span { color: var(--cyan); }

.tagline { color: var(--dim2); font-size: clamp(14px, 2.4vw, 17px); letter-spacing: .3px; margin: 16px 0 32px; max-width: 420px; }

.cta { display: flex; gap: 13px; flex-wrap: wrap; justify-content: center; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.foot {
  position: relative; z-index: 10; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 22px; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim);
}
.foot .sep { opacity: .5; }

/* ── Portal / modals — clean, dark, premium ──────────────────────────────── */
.pt-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(4,5,8,0.8); backdrop-filter: blur(6px); padding: 20px; animation: fade .18s ease; overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } }
.pt-modal {
  width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line2);
  border-radius: 8px; box-shadow: 0 40px 120px rgba(0,0,0,0.7); animation: rise .22s cubic-bezier(0.16,1,0.3,1); overflow: hidden;
}
.pt-modal.wide { max-width: 600px; }
@keyframes rise { from { transform: translateY(14px) scale(.985); opacity: 0; } }
.pt-head { display: flex; align-items: center; gap: 11px; padding: 20px 22px 0; }
.pt-head .badge { width: 34px; height: 34px; border-radius: 6px; background: var(--cyan-dim); color: var(--cyan); display: inline-flex; align-items: center; justify-content: center; }
.pt-head b { color: var(--white); font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.pt-x { margin-left: auto; background: none; border: none; color: var(--dim2); display: inline-flex; padding: 4px; border-radius: 5px; transition: all .15s ease; }
.pt-x:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.pt-body { padding: 18px 22px 24px; }
.pt-sub { color: var(--dim2); font-size: 13.5px; line-height: 1.55; margin-bottom: 20px; }

.pt-field { margin-bottom: 13px; }
.pt-field label { display: flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--dim2); margin-bottom: 7px; }
.pt-field label .ico { color: var(--dim); }
.pt-field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line2); border-radius: 6px;
  padding: 12px 14px; color: var(--white); font-size: 15px; letter-spacing: .2px;
}
.pt-field input::placeholder { color: var(--dim); }
.pt-field input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(47,224,200,0.13); }

.pt-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--cyan); color: #042420; border: 1px solid var(--cyan); font-weight: 700;
  font-size: 14px; letter-spacing: .3px; padding: 13px; border-radius: 6px; transition: all .15s ease;
}
.pt-btn:hover { background: var(--cyan-2); box-shadow: 0 8px 26px rgba(47,224,200,0.25); }
.pt-btn:active { transform: translateY(1px); }
.pt-btn.ghost { background: transparent; color: var(--white); border-color: var(--line2); }
.pt-btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: none; }
.pt-btn.danger { background: transparent; color: var(--red); border-color: rgba(224,83,63,0.35); }
.pt-btn.danger:hover { background: rgba(224,83,63,0.1); box-shadow: none; }
.pt-btn:disabled { opacity: .55; }
.ico { display: inline-flex; vertical-align: middle; }

.pt-err { background: rgba(224,83,63,0.1); border: 1px solid rgba(224,83,63,0.3); color: #ff8a76; font-size: 13px; border-radius: 6px; padding: 10px 13px; margin-bottom: 15px; }
.pt-ok { background: var(--cyan-dim); border: 1px solid rgba(47,224,200,0.3); color: var(--cyan); font-size: 13px; border-radius: 6px; padding: 10px 13px; margin-bottom: 15px; }
.pt-alt { text-align: center; font-size: 13px; color: var(--dim2); margin-top: 18px; }
.linklike { background: none; border: none; color: var(--cyan); cursor: pointer; font: inherit; }
.linklike:hover { color: var(--cyan-2); }

/* ── Account ─────────────────────────────────────────────────────────────── */
.acct-top { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.acct-av { width: 52px; height: 52px; border-radius: 8px; background: linear-gradient(135deg, var(--cyan), #189683); color: #042420; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; flex-shrink: 0; }
.acct-name { color: var(--white); font-weight: 700; font-size: 18px; }
.role-badge { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.4px; padding: 3px 8px; border-radius: 5px; margin-left: 10px; vertical-align: 3px; border: 1px solid transparent; }
.role-owner { background: rgba(224,83,63,0.12); color: var(--red); border-color: rgba(224,83,63,0.3); }
.role-admin { background: var(--cyan-dim); color: var(--cyan); border-color: rgba(47,224,200,0.3); }
.role-member { background: var(--line); color: var(--dim2); }
.acct-sub { font-size: 13px; color: var(--dim2); margin-top: 3px; }

.acct-stack { display: flex; flex-direction: column; gap: 14px; }
.acct-block { border: 1px solid var(--line); border-radius: 8px; padding: 17px; background: var(--bg2); }
.acct-block h4 { color: var(--white); font-size: 14px; margin-bottom: 5px; display: flex; align-items: center; gap: 9px; }
.acct-block h4 .ico { color: var(--cyan); }
.acct-block .hint { color: var(--dim2); font-size: 12.5px; margin-bottom: 14px; line-height: 1.5; }
.acct-block .pt-field { margin-bottom: 10px; }
.acct-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.acct-row .pt-btn { width: auto; padding: 11px 18px; }
.code-out { font-family: var(--mono); font-size: 14px; color: var(--cyan); background: var(--bg); border: 1px dashed var(--line2); border-radius: 5px; padding: 11px 13px; flex: 1; min-width: 0; overflow: auto; letter-spacing: 1px; white-space: nowrap; }
.mut { color: var(--dim); }

@media (max-width: 560px) { .wordmark span, .foot span:not(:first-child), .foot .sep { } }

/* ── Intro / preload screen ──────────────────────────────────────────────── */
#intro {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background-color: var(--bg); transition: opacity .6s ease, background-color .7s ease; cursor: pointer;
}
#intro.gone { opacity: 0; pointer-events: none; }
#intro.handing-off { background-color: transparent; pointer-events: none; }
#intro::before {
  content: ""; position: absolute; width: 40vmax; height: 40vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,224,200,0.14), transparent 65%); filter: blur(20px);
  transition: opacity .55s ease;
}
#intro.handing-off::before { opacity: 0; }
.intro-core { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.intro-mark { width: clamp(116px, 22vw, 168px); height: auto; filter: drop-shadow(0 0 24px rgba(47,224,200,0.42)); }
/* opacity:0 base keeps each ring fully hidden during its delay — otherwise the
   dash-offset seam leaves a stray 1-2px dot sitting at the path's start point. */
.intro-mark .ring { stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; animation: draw .9s cubic-bezier(0.5,0,0.2,1) forwards; }
.intro-mark .ring.d1 { animation-delay: .18s; }
.intro-mark .ring.d2 { animation-delay: .34s; }
.intro-mark .pop { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); animation: pop .5s cubic-bezier(0.16,1,0.3,1) .75s forwards; }
@keyframes draw { from { stroke-dashoffset: 100; opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }

.intro-word { font-size: clamp(30px, 6.5vw, 50px); font-weight: 800; letter-spacing: 8px; color: var(--white); margin-left: 8px; opacity: 0; transform: translateY(8px); animation: wordin .55s ease 1s forwards; }
.intro-word span { color: var(--cyan); }

.intro-bar { width: 150px; height: 2px; background: var(--line2); border-radius: 2px; overflow: hidden; opacity: 0; animation: fadein .3s ease .35s forwards; }
.intro-bar span { display: block; height: 100%; background: var(--cyan); transform: scaleX(0); transform-origin: left; animation: fill 1.5s cubic-bezier(0.6,0,0.2,1) .4s forwards; box-shadow: 0 0 10px var(--cyan); }
@keyframes wordin { to { opacity: 1; transform: none; } }
@keyframes fadein { to { opacity: 1; } }
@keyframes fill { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .intro-mark .ring, .intro-mark .pop, .intro-word, .intro-bar, .intro-bar span { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
}
