/* ============================================================================
   Oystro Standard & Portal Styles — Harness UI (Option 2 · Modern Infra Cyan)
   Uses canonical design tokens from tokens.css / home-critical.bundle.css.
   Zero inline styles; 100% compatible with enforcing style-src 'self'.
   ============================================================================ */

/* Canonical SVG logo mark colors (matches home.css) */
.mark-bg { fill: var(--accent); }
.mark-ink { fill: var(--accent-contrast); }

/* Prevent browser autofill from painting bright yellow backgrounds on dark inputs */
.portal-input:-webkit-autofill,
.portal-input:-webkit-autofill:hover,
.portal-input:-webkit-autofill:focus,
.code-input:-webkit-autofill,
.code-input:-webkit-autofill:hover,
.code-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--code-bg) inset;
  box-shadow: 0 0 0 1000px var(--code-bg) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

.portal-hidden {
  display: none !important;
}

/* Main layout shells — always clear the fixed 72px masthead */
.portal-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 120px 24px 88px;
  min-height: calc(100vh - 180px);
}

.portal-main-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 120px 24px 88px;
  min-height: calc(100vh - 180px);
}

.auth-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 124px 24px 88px;
  min-height: calc(100vh - 180px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Centered Authentication & Activation Card */
.auth-card,
.act-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 40px 36px;
  background: linear-gradient(170deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 56px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-header {
  text-align: center;
}

.act-wrap {
  text-align: center;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  margin-bottom: 16px;
}

.auth-title,
.act-wrap h1,
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}

.auth-sub,
.act-wrap p,
.page-header p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 26px;
}

.page-header {
  margin-bottom: 28px;
}

/* Form controls */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.portal-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.portal-input::placeholder {
  color: var(--text-faint);
}

.portal-input:focus,
.code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.otp-input {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
  color: var(--accent);
}

.code-input {
  width: 100%;
  padding: 14px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  background: var(--code-bg);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input {
  max-width: 300px;
}

/* Buttons */
.btn,
.btn-full,
.btn-auth,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:hover,
.btn-full:hover,
.btn-auth:hover,
.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 6px 20px var(--accent-soft);
}

.btn:disabled,
.btn-full:disabled,
.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full,
.btn-auth {
  width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--accent);
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  border: 1px solid var(--line-accent);
  color: var(--text);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.btn-oauth:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  color: var(--text);
  opacity: 1;
  transform: translateY(-1px);
}

.btn-oauth svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.nav-links a.btn-sm,
.nav-links a.btn-sm:hover,
.masthead .nav-links a.btn-sm,
.masthead .nav-links a.btn-sm:hover,
.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #000000;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-sm:hover {
  background: var(--accent-bright);
  color: #000000;
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--line-accent);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Status message box */
.msg {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}

.msg:not(:empty) {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  border: 1px solid var(--line);
}

.msg.is-error {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(248, 113, 113, 0.35);
}

.msg.is-success {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.35);
}

/* Dashboard cards & surfaces */
.portal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px var(--shadow);
}

.portal-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.portal-card h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 24px 0 12px;
}

.portal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.portal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.portal-muted {
  color: var(--text-muted);
  font-size: 14px;
}

.portal-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.portal-link:hover {
  text-decoration: underline;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

/* Device list */
.device-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.device-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 14px;
}

/* Tables */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  box-shadow: 0 12px 32px var(--shadow);
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table th,
.portal-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

.portal-table th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(3, 8, 16, 0.35);
}

.portal-table tr:last-child td {
  border-bottom: none;
}

.portal-table code {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  color: var(--accent);
}

/* Standard Edition Landing Page */
.std-hero {
  max-width: 960px;
  margin: 0 auto;
  padding: 148px 24px 64px;
  text-align: center;
}

.std-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  margin-bottom: 24px;
}

.std-h1 {
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 800;
  line-height: 1.08;
  color: var(--text);
  margin: 0 0 20px;
  letter-spacing: -0.03em;
}

.std-sub {
  font-size: clamp(16.5px, 2vw, 19.5px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 36px;
}

.std-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.std-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.std-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  text-align: left;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.std-card:hover {
  border-color: var(--line-accent);
  transform: translateY(-2px);
}

.std-card h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.std-card p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.std-card code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.std-compare {
  max-width: 1000px;
  margin: 0 auto 88px;
  padding: 0 24px;
}

.std-compare h2 {
  text-align: center;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text);
}

/* Download boxes */
.dl-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px var(--shadow);
}

.dl-box h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: var(--text);
}

.cmd {
  background: var(--code-bg);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  border: 1px solid var(--line);
  overflow-x: auto;
  margin-bottom: 12px;
}

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.dl-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.dl-link:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.dl-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Humanized Standard Home Sections */
.std-section {
  max-width: 1000px;
  margin: 0 auto 72px;
  padding: 0 24px;
}

.std-section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 32px;
}

.std-section-head h2 {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text);
}

.std-section-sub {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.std-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.std-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 26px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.std-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--line-accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.std-step h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.std-step p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.std-risk-callout {
  background: var(--surface);
  border: 1px solid var(--line-accent);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 12px 32px var(--shadow);
}

.std-risk-callout h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.std-risk-callout p {
  margin: 0 0 12px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

.std-risk-callout p:last-child {
  margin-bottom: 0;
}

.std-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.std-check-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 8px 22px var(--shadow);
}

.std-check-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--line-accent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.std-check-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.std-check-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* EULA Gate */
.eula-box {
  border-color: var(--line-accent);
  margin-bottom: 18px;
}

.eula-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 10px;
  text-align: left;
}

.eula-label input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.dl-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

/* Out-of-band Gate Approval Portal */
.gate-card {
  max-width: 640px;
  text-align: left;
}

.gate-code-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 18px;
}

.gate-code-row .code-input {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0.12em;
}

.gate-review {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 6px;
}

.gate-grid {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 8px 14px;
  margin: 0 0 18px;
  font-size: 13.5px;
}

.gate-grid dt {
  color: var(--text-muted);
  font-weight: 600;
}

.gate-grid dd {
  margin: 0;
  color: var(--text);
  word-break: break-word;
}

.gate-digest {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

.gate-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.btn-reject {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
}

.gate-batch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  margin: 0 0 18px;
  padding-right: 4px;
}

.gate-batch-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  font-size: 13px;
}

.gate-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.gate-batch-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  margin-bottom: 4px;
  word-break: break-all;
}

.gate-batch-goal {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.btn-reject:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
