/* Bellova CORP O365 Migrator — public consent page */

:root {
  --bv-blue: #0055A4;
  --bv-blue-dark: #004490;
  --bv-blue-soft: rgba(0, 85, 164, 0.08);
  --bv-yellow: #FFCD00;
  --bv-green: #00A95C;
  --bv-green-dark: #008f4e;
  --bv-green-soft: rgba(0, 169, 92, 0.08);

  --bg: #f6f7fb;
  --bg-grad: radial-gradient(circle at 20% 0%, #eef2ff 0%, transparent 50%),
             radial-gradient(circle at 90% 10%, #ecfdf5 0%, transparent 45%),
             #f6f7fb;
  --surface: #ffffff;
  --surface-alt: #f4f5f9;
  --border: #e4e7ee;
  --border-strong: #cdd2dc;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --success-bg: #f0fdf4;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.06), 0 2px 6px rgba(15, 23, 42, 0.03);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-grad);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100%;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 64px;
}

/* ─── Brand header ─────────────────────────────────────────────── */
.brand {
  text-align: center;
  margin-bottom: 28px;
}
.logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: var(--shadow);
}
.brand h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 12px 0 4px;
  letter-spacing: -0.02em;
  font-feature-settings: "kern" 1;
}
.brand-blue { color: var(--bv-blue); }
.brand-yellow { color: var(--bv-yellow); }
.tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Hero ─────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
  padding: 0 8px;
}
.hero h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--text);
  line-height: 1.25;
}
.hero p {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}
.hero strong { color: var(--text); }
.hero em { font-style: normal; color: var(--bv-blue); font-weight: 600; }

/* ─── Stepper ──────────────────────────────────────────────────── */
.stepper {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.step.done {
  border-color: rgba(22, 163, 74, 0.3);
  background: var(--success-bg);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.step.done .step-num {
  background: var(--success);
  color: white;
}
.step.done .step-num::before {
  content: "✓";
  font-size: 16px;
}
.step.done .step-num > * { display: none; }
.step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  text-align: left;
}
.step-label em {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}
.step-sep {
  flex: 0 0 32px;
  height: 1px;
  background: var(--border-strong);
  list-style: none;
}

/* ─── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card.secondary {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

/* ─── Dual grant grid ──────────────────────────────────────────── */
.grant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .grant-grid { grid-template-columns: 1fr; }
  .stepper { flex-wrap: wrap; }
  .step-sep { display: none; }
}

.grant-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.grant-card.grant-source { border-top: 3px solid var(--bv-blue); }
.grant-card.grant-dest { border-top: 3px solid var(--bv-green); }
.grant-card.done {
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.04) 0%, var(--surface) 70%);
  border-color: rgba(22, 163, 74, 0.25);
}

.grant-head {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 12px;
}
.grant-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--text);
  flex-shrink: 0;
}
.grant-source .grant-step-badge { background: var(--bv-blue-soft); color: var(--bv-blue); }
.grant-dest .grant-step-badge { background: var(--bv-green-soft); color: var(--bv-green); }
.grant-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.grant-source .grant-svg { color: var(--bv-blue); }
.grant-dest .grant-svg { color: var(--bv-green); }
.grant-head h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.grant-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.grant-state {
  grid-column: 1 / -1;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--success);
  color: white;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  align-self: start;
  width: fit-content;
}
.grant-state svg { width: 12px; height: 12px; }
.grant-state.hidden { display: none; }

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--bv-blue);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 10px rgba(0, 85, 164, 0.18);
}
.btn-primary svg { width: 16px; height: 16px; }
.btn-primary:hover { background: var(--bv-blue-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary.inline-link { width: auto; margin-top: 8px; }

.btn-source { background: var(--bv-blue); }
.btn-source:hover { background: var(--bv-blue-dark); }
.btn-dest { background: var(--bv-green); box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 4px 10px rgba(0, 169, 92, 0.18); }
.btn-dest:hover { background: var(--bv-green-dark); }

.grant-card.done .btn-primary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  font-weight: 500;
}
.grant-card.done .btn-primary:hover {
  background: var(--surface-alt);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary svg { width: 13px; height: 13px; }
.btn-secondary:hover { background: var(--surface-alt); }
.btn-secondary.copied { background: var(--success-bg); border-color: rgba(22, 163, 74, 0.3); color: var(--success); }

.btn-icon {
  display: inline-block;
  font-size: 1.05em;
  line-height: 1;
}

.hint {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Permissions list ─────────────────────────────────────────── */
.details {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0;
  font-size: 13px;
}
.details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  position: relative;
  padding-right: 20px;
  font-size: 12.5px;
}
.details summary::-webkit-details-marker { display: none; }
.details summary::after {
  content: '▾';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.details[open] summary::after { transform: rotate(180deg); }
.details p {
  color: var(--text-muted);
  margin: 8px 0;
  font-size: 12.5px;
  line-height: 1.5;
}
.perms {
  list-style: none;
  padding: 0;
  margin: 10px 0 6px;
  font-size: 12px;
}
.perms li {
  padding: 5px 0;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  line-height: 1.5;
}
.perms li:last-child { border-bottom: none; }
.perms strong {
  color: var(--text);
  display: inline-block;
  min-width: 88px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.perms code {
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--bv-blue);
  font-weight: 500;
  border: 1px solid var(--border);
}
.note {
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Trust strip ──────────────────────────────────────────────── */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 720px) {
  .trust-strip { grid-template-columns: 1fr; }
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.trust-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--bv-blue);
  margin-top: 1px;
}
.trust-item h4 {
  margin: 0 0 3px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.trust-item p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ─── Steps (How it works) ─────────────────────────────────────── */
.steps {
  margin: 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.steps li { padding: 4px 0; }
.steps em { color: var(--text); font-style: normal; font-weight: 600; }

.restrict-intro {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.55;
}
.restrict-intro code {
  background: var(--surface-alt);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--bv-blue);
  border: 1px solid var(--border);
}

/* ─── Status icons (callback) ──────────────────────────────────── */
.status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin: 0 auto 16px;
}
.status-icon.success { background: var(--success); }
.status-icon.error { background: var(--danger); }

/* ─── Tenant ID display (callback success) ─────────────────────── */
.tid-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tid-box .label {
  width: 100%;
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.tid-box code {
  flex: 1;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 0;
  overflow-x: auto;
}

.next-steps {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.next-steps ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.next-steps li { padding: 3px 0; }

/* ─── PowerShell code block ────────────────────────────────────── */
.restrict-details {
  background: white;
  border-color: var(--border);
  margin-top: 8px;
}
.code-wrap {
  position: relative;
  margin-top: 10px;
}
.code-wrap pre {
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  color: #e2e8f0;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 18px 18px 18px 20px;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.code-wrap pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  border: none;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,0.92);
  font-size: 11.5px;
  padding: 5px 10px;
  z-index: 1;
  backdrop-filter: blur(4px);
}
.code-copy:hover { background: white; }

/* ─── Error pre ────────────────────────────────────────────────── */
pre {
  background: var(--danger-bg);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11.5px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--danger);
}

/* ─── Footer ───────────────────────────────────────────────────── */
.page-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-muted);
}
.page-footer p { margin: 4px 0; }
.legal { font-size: 10.5px; opacity: 0.85; max-width: 600px; margin: 0 auto !important; line-height: 1.55; }

.hidden { display: none !important; }

/* ─── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .page { padding: 32px 16px 48px; }
  .card { padding: 22px; }
  .hero h2 { font-size: 22px; }
  .grant-card { padding: 18px; }
}

/* ─── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
