/* Aqlyx Onboarding Portal */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --teal:         #0F6E56;
  --teal-dark:    #085041;
  --teal-light:   #E6F4F0;
  --teal-mid:     #B8DDD5;
  --bg:           #FAFAF8;
  --surface:      #FFFFFF;
  --border:       #E4E0D6;
  --border-focus: #0F6E56;
  --text:         #2C2C2A;
  --muted:        #6B6A67;
  --subtle:       #9B9A97;
  --amber:        #F59E0B;
  --amber-bg:     #FFFBEB;
  --amber-border: #FDE68A;
  --success:      #059669;
  --success-bg:   #ECFDF5;
  --danger:       #DC2626;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --radius:       12px;
  --radius-sm:    8px;
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 15px;
  line-height: 1.5;
}

/* ─────────────────────────────────────────────
   Header
───────────────────────────────────────────── */
.portal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 32px;
  height: 60px;
  background: #0A1628;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.logo {
  font-size: 19px;
  font-weight: 700;
  color: #20D5CF;
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo span { color: #FFFFFF; }
.tagline {
  font-size: 12px;
  color: #4A6080;
  font-weight: 400;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

/* ─────────────────────────────────────────────
   Main layout
───────────────────────────────────────────── */
.portal-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 60px;
}

/* ─────────────────────────────────────────────
   Wizard card
───────────────────────────────────────────── */
.wizard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 520px;
}
.wizard-card.wide { max-width: 760px; }

/* ─────────────────────────────────────────────
   Step progress bar
───────────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  gap: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--subtle);
  white-space: nowrap;
  flex-shrink: 0;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  flex-shrink: 0;
}
.step-label { display: none; }
.step.active .step-num {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.step.active .step-label { display: inline; color: var(--text); font-weight: 600; }
.step.done .step-num {
  background: var(--teal-light);
  border-color: var(--teal-mid);
  color: var(--teal);
}
.step-connector {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  min-width: 16px;
  max-width: 40px;
}
.step-connector.done { background: var(--teal-mid); }

/* ─────────────────────────────────────────────
   Typography
───────────────────────────────────────────── */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.page-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}
h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

/* ─────────────────────────────────────────────
   Form elements
───────────────────────────────────────────── */
.portal-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.1);
}
.field input::placeholder { color: #C5C3BE; }

/* Shopify domain input with suffix */
.input-group { display: flex; }
.input-group input {
  flex: 1;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
}
.input-suffix {
  padding: 10px 14px;
  background: #F4F2EC;
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ─────────────────────────────────────────────
   Buttons
───────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: var(--teal);
  color: #fff;
  border: 1.5px solid var(--teal-dark);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
  letter-spacing: -0.1px;
}
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal-mid);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--teal-light); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--teal);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ─────────────────────────────────────────────
   OAuth connect button
───────────────────────────────────────────── */
.oauth-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.oauth-btn:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-sm);
}
.oauth-btn .oauth-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.oauth-btn .oauth-label { flex: 1; text-align: left; }
.oauth-btn .oauth-arrow { color: var(--subtle); margin-left: auto; }

/* ─────────────────────────────────────────────
   Source cards (Step 3)
───────────────────────────────────────────── */
.source-category { margin-bottom: 28px; }
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.source-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  background: #fff;
}
.source-card:hover:not(.disabled) {
  border-color: var(--teal-mid);
  box-shadow: var(--shadow-sm);
}
.source-card.selected {
  border-color: var(--teal);
  background: var(--teal-light);
}
.source-card.disabled { opacity: 0.45; cursor: not-allowed; }

.source-card input[type="checkbox"] {
  position: absolute;
  top: 12px;
  right: 12px;
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
}

.source-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding-right: 20px;
}
.source-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.source-requires {
  font-size: 11px;
  color: var(--amber);
  font-weight: 500;
}
.source-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
  margin-top: auto;
  padding-top: 8px;
}
.source-price.coming-soon {
  color: var(--subtle);
  font-weight: 400;
  font-style: italic;
}

/* ─────────────────────────────────────────────
   Price summary
───────────────────────────────────────────── */
.price-summary {
  background: #F4F2EC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.price-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  color: var(--muted);
}
.price-total {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
}

/* ─────────────────────────────────────────────
   Review page
───────────────────────────────────────────── */
.review-block {
  background: #F4F2EC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.trial-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.trial-callout-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
.trial-callout-text { font-size: 13px; color: #78350F; line-height: 1.5; }
.trial-callout-text strong { display: block; font-weight: 600; margin-bottom: 2px; color: #92400E; }

/* ─────────────────────────────────────────────
   Property picker
───────────────────────────────────────────── */
.property-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.property-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}
.property-row:has(input:checked) { border-color: var(--teal); background: var(--teal-light); }
.property-row:hover { border-color: var(--teal-mid); }
.property-row input[type="radio"] { accent-color: var(--teal); }
.property-name { font-size: 14px; font-weight: 500; flex: 1; }
.property-id { font-size: 11px; color: var(--subtle); font-family: monospace; }

/* ─────────────────────────────────────────────
   Success page
───────────────────────────────────────────── */
.success-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}
.success-icon {
  width: 60px;
  height: 60px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 20px;
  box-shadow: 0 0 0 8px var(--success-bg);
}
.success-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.success-sub { font-size: 14px; color: var(--muted); max-width: 340px; line-height: 1.6; }

.credentials-box {
  background: #0C1628;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 24px;
}
.creds-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--amber);
  font-weight: 500;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.creds-table { width: 100%; border-collapse: collapse; }
.creds-table tr + tr td { padding-top: 10px; }
.creds-table td { vertical-align: top; font-size: 13px; }
.creds-table td:first-child { color: #4A6080; width: 90px; padding-top: 2px; font-size: 12px; }
.creds-table code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #20D5CF;
  font-size: 14px;
  background: rgba(32,213,207,0.07);
  padding: 1px 6px;
  border-radius: 4px;
}
.creds-table a { color: #20D5CF; text-decoration: none; font-size: 13px; word-break: break-all; }
.creds-table a:hover { text-decoration: underline; }

.next-steps-block { margin-bottom: 24px; }
.next-steps-block h3 { margin-bottom: 12px; }
.next-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.next-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─────────────────────────────────────────────
   Dashboard card
───────────────────────────────────────────── */
.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 600px;
}
.source-status-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.source-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.source-status-row.connected { border-color: var(--teal-mid); background: var(--teal-light); }
.badge-connected {
  font-size: 11px;
  font-weight: 600;
  background: var(--success);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: auto;
}
.badge-pending {
  font-size: 11px;
  font-weight: 600;
  background: var(--amber-bg);
  color: #92400E;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--amber-border);
  margin-left: auto;
}
.billing-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─────────────────────────────────────────────
   Divider
───────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ─────────────────────────────────────────────
   Fine print / misc
───────────────────────────────────────────── */
.fine-print {
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.6;
  text-align: center;
  margin-top: 16px;
}
.fine-print a { color: var(--muted); }

.info-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13px;
  color: #1E40AF;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ─────────────────────────────────────────────
   Footer
───────────────────────────────────────────── */
.portal-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--subtle);
  border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────────
   Add Sources marketplace page
───────────────────────────────────────────── */
.add-sources-wrap {
  width: 100%;
  max-width: 860px;
  padding: 0 16px 60px;
}
.add-sources-header {
  margin-bottom: 36px;
}
.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s;
}
.back-link:hover { color: var(--teal); }
.add-sources-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.src-section { margin-bottom: 36px; }
.src-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.src-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.src-card:hover:not(.is-soon) {
  border-color: var(--teal-mid);
  box-shadow: var(--shadow-sm);
}
.src-card.is-connected { border-color: var(--teal-mid); background: var(--teal-light); }
.src-card.is-soon { opacity: 0.55; }

.src-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Brand logo circles */
.src-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.src-logo-shopify        { background: #5C6AC4; }
.src-logo-meta           { background: #1877F2; }
.src-logo-google_ads     { background: #4285F4; }
.src-logo-search_console { background: #34A853; }
.src-logo-influencer     { background: #E1306C; }
.src-logo-amazon         { background: #FF9900; }
.src-logo-trendyol       { background: #F27A1A; }

.src-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.src-badge.connected { background: var(--success); color: #fff; }
.src-badge.soon { background: #F4F2EC; color: var(--muted); border: 1px solid var(--border); }

.src-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.src-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.src-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.src-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.src-price span { font-size: 11px; font-weight: 400; color: var(--muted); }

.src-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.src-btn.connect {
  background: var(--teal);
  color: #fff;
  border: 1.5px solid var(--teal-dark);
}
.src-btn.connect:hover { background: var(--teal-dark); }
.src-btn.connected, .src-btn.active {
  background: var(--success-bg);
  color: var(--success);
  border: 1.5px solid #A7F3D0;
  cursor: default;
}
.src-btn.soon {
  background: #F4F2EC;
  color: var(--subtle);
  border: 1.5px solid var(--border);
  cursor: default;
}

/* dashboard card add-sources link */
.btn-add-sources {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: transparent;
  color: var(--teal);
  border: 1.5px dashed var(--teal-mid);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  margin-bottom: 20px;
  transition: background 0.15s, border-color 0.15s;
}
.btn-add-sources:hover { background: var(--teal-light); border-color: var(--teal); }

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 560px) {
  .portal-main { padding: 20px 12px 40px; }
  .wizard-card, .dashboard-card { padding: 28px 20px; }
  .wizard-card.wide { padding: 24px 16px; }
  .portal-header { padding: 0 20px; }
  .step-label { display: none !important; }
  .source-grid { grid-template-columns: 1fr; }
  .src-grid { grid-template-columns: 1fr; }
  .add-sources-wrap { padding: 0 0 40px; }
}
