/* Cyfron design tokens (from Connect with Cyfron kit v1.0). */
:root {
    --cy-blue: #4d7cff;
    --cy-blue-deep: #3b62d8;
    --cy-blue-700: #2a4bb8;
    --cy-blue-glow: rgba(77, 124, 255, .35);
    --cy-ink: #0e1422;
    --cy-text-muted: #4a5063;
    --cy-text-dim: #6b7384;
    --cy-border: #e3e6ec;
    --cy-border-strong: #c9cfdb;
    --cy-surface: #ffffff;
    --cy-surface-soft: #fafbfd;
    --cy-bg: #f5f6f9;
    --cy-success: #2e8b57;
    --cy-success-bg: rgba(46, 139, 87, .08);
    --cy-error: #c94b4b;
    --cy-error-bg: rgba(201, 75, 75, .08);
    --cy-info: #4d7cff;
    --cy-info-bg: rgba(77, 124, 255, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--cy-bg);
    color: var(--cy-ink);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    padding: 24px;
}
.card {
    background: var(--cy-surface);
    border: 1px solid var(--cy-border);
    border-radius: 16px;
    padding: 36px 32px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 1px 2px rgba(20, 30, 80, .04);
}
.eyebrow {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cy-blue);
    margin-bottom: 14px;
}
h1 {
    font-family: 'Space Grotesk', Inter, sans-serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin-bottom: 8px;
}
.lede {
    font-size: 14.5px;
    color: var(--cy-text-muted);
    line-height: 1.55;
    margin-bottom: 24px;
}
.lede strong { font-weight: 600; color: var(--cy-ink); }
.attrs {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--cy-ink);
}
.mode-chip {
    display: inline-block;
    padding: 2px 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
}
.mode-chip.open {
    background: var(--cy-info-bg);
    color: var(--cy-blue-700);
}
.mode-chip.invite_only, .mode-chip.invite-only {
    background: rgba(201, 75, 75, .08);
    color: var(--cy-error);
}

/* ===== V3 · Outline ghost Connect-with-Cyfron button ===== */
.cy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.005em;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    line-height: 1;
    background: transparent;
    color: inherit;
    -webkit-font-smoothing: antialiased;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.cy-btn:active { transform: translateY(0.5px); }
.cy-btn:focus-visible {
    outline: 3px solid var(--cy-blue-glow);
    outline-offset: 2px;
}
.cy-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.cy-btn-outline {
    color: var(--cy-ink);
    border-color: var(--cy-border-strong);
}
.cy-btn-outline:not(:disabled):hover {
    background: rgba(77, 124, 255, .06);
    border-color: var(--cy-blue);
    color: var(--cy-blue-700);
}
.copy-url-link {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--cy-text-dim);
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: transparent;
    transition: color .15s, text-decoration-color .15s;
}
.copy-url-link:hover {
    color: var(--cy-blue-700);
    text-decoration-color: var(--cy-blue-700);
}

/* ===== Sign in from your phone (QR code) ===== */
.qr-wrap {
    margin-top: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--cy-border);
    border-radius: 12px;
    background: var(--cy-surface-soft);
}
.qr-code {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
}
.qr-code img, .qr-code canvas { display: block; }
.qr-caption {
    margin-top: 12px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--cy-text-muted);
    max-width: 260px;
}

/* ===== Invite token field ===== */
.field {
    margin-top: 20px;
    display: block;
}
.field-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--cy-text-dim);
    margin-bottom: 6px;
}
.field-label .hint {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: .05em;
    text-transform: uppercase;
}
input[type="text"], textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--cy-border);
    border-radius: 10px;
    background: var(--cy-surface);
    color: var(--cy-ink);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    resize: vertical;
}
input[type="text"]:focus, textarea:focus {
    border-color: var(--cy-blue);
    box-shadow: 0 0 0 3px var(--cy-blue-glow);
}
textarea { min-height: 80px; }

/* ===== Status ===== */
.status {
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
    border: 1px solid transparent;
}
.status.pending {
    background: var(--cy-info-bg);
    border-color: rgba(77, 124, 255, .25);
    color: var(--cy-blue-700);
}
.status.success {
    background: var(--cy-success-bg);
    border-color: rgba(46, 139, 87, .25);
    color: var(--cy-success);
}
.status.error {
    background: var(--cy-error-bg);
    border-color: rgba(201, 75, 75, .25);
    color: var(--cy-error);
}
.hidden { display: none !important; }

/* ===== Service trust anchor (OOBI) =====
   The OOBI itself is never rendered — only a one-line explanation and a
   copy button, so the card doesn't end in a wall of JSON. */
.service-info {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--cy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.service-info .label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cy-text-dim);
    min-width: 0;
}
.copy-oobi {
    flex-shrink: 0;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--cy-blue-700);
    background: var(--cy-surface-soft);
    border: 1px solid var(--cy-border);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.copy-oobi:hover {
    border-color: var(--cy-border-strong);
    background: var(--cy-info-bg);
}

/* Version footer — small and dim at the bottom of the card. */
.dauthz-build {
    margin-top: 18px;
    text-align: center;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10.5px;
    color: var(--cy-text-dim);
    opacity: .7;
    letter-spacing: .02em;
}

/* 1.2.0: optional access requirement line (e.g. "Requires a Research Passport"). */
.access-requirement { margin-top: -6px; font-weight: 500; }
