/* ============================================================
   connect.css — Self-contained styles for /connect/coros.
   Single focused page, no top nav, dark theme.
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Design tokens ──────────────────────────────────────── */
:root {
  --black: #000;
  --white: #fff;
  --offwhite: #F8F8F6;
  --g1: #B0B0B0;
  --g2: #777;
  --g3: #444;
  --g4: #222;
  --g5: #E8E8E8;
  --green: #2AFF00;
  --red: #FF4444;
  --fh: 'Outfit', sans-serif;
  --fb: 'Inter', sans-serif;
  --fn: 'Exo 2', sans-serif;
}

/* ── Base ───────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: var(--fb);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img { display: block; max-width: 100%; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ── TOP BAR ────────────────────────────────────────────── */
.connect-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 40px);
  height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.connect-bar-logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.connect-bar-logo img {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.connect-bar-help {
  font-family: var(--fh);
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .6);
  transition: color .2s;
}

.connect-bar-help:hover { color: var(--white); }

/* ── STATE CONTAINER ────────────────────────────────────── */
.connect-state {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 5vh, 64px) clamp(20px, 4vw, 40px);
}

.connect-state[data-state="active"] {
  display: flex;
}

.connect-card {
  width: 100%;
  max-width: 560px;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: clamp(28px, 5vw, 48px);
}

/* ── TAG ────────────────────────────────────────────────── */
.connect-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fh);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .65);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 100px;
  background: rgba(255, 255, 255, .03);
  margin-bottom: 24px;
}

.connect-tag-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  flex-shrink: 0;
}

.connect-tag-dot-green {
  background: var(--green);
  box-shadow: 0 0 8px rgba(42, 255, 0, .4);
}

.connect-tag-dot-red {
  background: var(--red);
}

.connect-tag-ready {
  color: var(--white);
}

.connect-tag-ready span:last-child {
  color: rgba(255, 255, 255, .55);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  margin-left: 4px;
}

.connect-tag-error {
  border-color: rgba(255, 68, 68, .2);
  color: rgba(255, 255, 255, .85);
}

/* ── HEADING ────────────────────────────────────────────── */
.connect-heading {
  font-family: var(--fh);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 14px;
}

.connect-body {
  font-family: var(--fb);
  font-size: .92rem;
  color: rgba(255, 255, 255, .65);
  line-height: 1.65;
  margin-bottom: clamp(24px, 4vh, 36px);
}

.connect-body a {
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  transition: border-color .2s;
}

.connect-body a:hover {
  border-color: var(--white);
}

/* ── STEPS (gated state) ────────────────────────────────── */
.connect-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(28px, 4vh, 40px);
}

.connect-step {
  display: flex;
  gap: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
}

.connect-step-num {
  font-family: var(--fn);
  font-size: .85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .35);
  letter-spacing: .02em;
  flex-shrink: 0;
  min-width: 24px;
}

.connect-step-text {
  flex: 1;
}

.connect-step-h {
  font-family: var(--fh);
  font-size: .92rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -.01em;
  margin-bottom: 4px;
}

.connect-step-p {
  font-family: var(--fb);
  font-size: .8rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.5;
}

.connect-step-p a {
  color: rgba(255, 255, 255, .85);
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  transition: border-color .2s;
}

.connect-step-p a:hover { border-color: var(--white); }

/* ── PERMISSIONS LIST (ready state) ─────────────────────── */
.connect-perms {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: clamp(24px, 4vh, 32px);
}

.connect-perms-head {
  font-family: var(--fh);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 14px;
}

.connect-perms-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.connect-perms-list li {
  font-family: var(--fb);
  font-size: .85rem;
  color: rgba(255, 255, 255, .75);
  line-height: 1.65;
  padding: 7px 0;
  padding-left: 22px;
  position: relative;
}

.connect-perms-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 12px;
  height: 1px;
  background: rgba(255, 255, 255, .25);
}

.connect-perms-list li a {
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  transition: border-color .2s;
}

.connect-perms-list li a:hover { border-color: var(--white); }

.connect-perms-foot {
  font-family: var(--fb);
  font-size: .8rem;
  color: rgba(255, 255, 255, .45);
  line-height: 1.6;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.connect-perms-foot a {
  color: rgba(255, 255, 255, .8);
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  transition: border-color .2s;
}

.connect-perms-foot a:hover { border-color: var(--white); }

/* ── CONNECT BUTTON ─────────────────────────────────────── */
.connect-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-family: var(--fh);
  font-size: 1rem;
  font-weight: 600;
  color: var(--black);
  background: var(--green);
  padding: 16px 24px;
  border-radius: 10px;
  transition: transform .2s, box-shadow .2s;
  margin-bottom: 20px;
}

.connect-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(42, 255, 0, .2);
}

.connect-cta:active {
  transform: translateY(0);
}

.connect-cta:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.connect-cta svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── DISCONNECT NOTE (ready state) ──────────────────────── */
.connect-disconnect {
  font-family: var(--fb);
  font-size: .8rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.65;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 8px;
  margin-bottom: clamp(20px, 3vh, 28px);
}

.connect-disconnect strong {
  color: rgba(255, 255, 255, .75);
  font-weight: 600;
}

/* ── FOOT NAV ───────────────────────────────────────────── */
.connect-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: clamp(20px, 3vh, 28px);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.connect-back,
.connect-help {
  font-family: var(--fh);
  font-size: .82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .5);
  transition: color .2s;
}

.connect-back:hover,
.connect-help:hover { color: var(--white); }

/* ── LOADING SPINNER ────────────────────────────────────── */
.connect-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  color: rgba(255, 255, 255, .65);
  animation: connect-spin 1s linear infinite;
}

.connect-spinner svg {
  width: 100%;
  height: 100%;
}

@keyframes connect-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.connect-loading-label {
  font-family: var(--fb);
  font-size: .88rem;
  color: rgba(255, 255, 255, .5);
  text-align: center;
}

/* The loading card is centered & no border to feel lighter */
#stateLoading .connect-card {
  background: transparent;
  border: none;
  padding: clamp(20px, 4vw, 32px);
  text-align: center;
}

/* ── FOOTER ─────────────────────────────────────────────── */
.connect-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px clamp(20px, 4vw, 40px);
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-family: var(--fb);
  font-size: .78rem;
  color: rgba(255, 255, 255, .35);
  flex-shrink: 0;
}

.connect-footer a {
  color: rgba(255, 255, 255, .55);
  transition: color .2s;
}

.connect-footer a:hover { color: var(--white); }

.connect-footer-sep {
  margin: 0 8px;
  opacity: .5;
}

/* ── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .connect-spinner {
    animation-duration: 2s;
  }
  .connect-cta {
    transition: none;
  }
}

/* ── MOBILE ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  .connect-bar-logo img { height: 48px; }
  .connect-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .connect-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}
