/* ════════════════════════════════
   ONBOARDING FLOW — Sprint 22
   ════════════════════════════════ */

/* ── Progress bar ── */
.auth-screen { position: relative; } /* needed for absolute bar positioning */

#onb-progress-bar {
  position: absolute;
  top: 12px;
  left: 24px;
  right: 24px;
  height: 6px;
  background: var(--bg2);
  border-radius: 6px;
  opacity: 0;
  transition: opacity .3s;
  z-index: 10;
}
#onb-progress-bar.onb-progress-visible { opacity: 1; }

#onb-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--terra);
  border-radius: 6px;
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

#onb-content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Welcome screen ── */
.onb-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  padding: 0 8px;
}

/* Rocky AI badge — two stacked violet squares */
.onb-badge {
  position: relative;
  width: 56px;
  height: 56px;
  margin-bottom: 32px;
}
.onb-badge-sq {
  position: absolute;
  width: 38px;
  height: 38px;
  background: var(--violet);
  border-radius: 10px;
}
.onb-badge-sq:first-child {
  top: 0;
  left: 0;
  opacity: 0.5;
  transform: rotate(-8deg);
}
.onb-badge-sq--2 {
  bottom: 0;
  right: 0;
  opacity: 1;
  transform: rotate(6deg);
}

.onb-welcome-title {
  font-family: 'Lora', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--t1);
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.onb-welcome-sub {
  font-size: 16px;
  color: var(--t3);
  line-height: 1.6;
  margin: 0 0 40px;
}

.onb-btn-primary {
  width: 100%;
  max-width: 320px;
  padding: 16px;
  border-radius: 14px;
  background: var(--terra);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity .15s;
}
.onb-btn-primary:active { opacity: .85; }

/* ── Step cards (Auth / Identity / GCal) ── */
.onb-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(26,20,10,.18);
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.onb-progress {
  font-size: 11px;
  font-weight: 600;
  color: var(--t4);
  letter-spacing: .8px;
  text-transform: uppercase;
}

.onb-card-title {
  font-family: 'Lora', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--t1);
  margin: 0;
  line-height: 1.25;
}

.onb-card-sub {
  font-size: 14px;
  color: var(--t3);
  margin: -8px 0 0;
  line-height: 1.5;
}

/* ── Auth form within card ── */
.onb-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Identity fields ── */
.onb-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.onb-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t4);
  letter-spacing: .7px;
  text-transform: uppercase;
}

.onb-tag-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s;
}
.onb-tag-row:focus-within { border-color: var(--terra); }

.onb-tag-prefix {
  padding: 14px 4px 14px 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--t3);
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}

.onb-tag-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px 14px 2px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--t1);
  outline: none;
}

.onb-tag-status {
  font-size: 13px;
  color: var(--t3);
  min-height: 18px;
}
.onb-tag-status.ok    { color: #16A34A; }
.onb-tag-status.error { color: var(--terra); }

.onb-tag-warning {
  font-size: 12px;
  color: var(--t3);
  background: var(--bg2);
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.5;
  margin: 0;
}

/* ── GCal skip button ── */
.onb-gcal-btn { margin-top: 4px; }

.onb-btn-skip {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--t3);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  touch-action: manipulation;
  transition: color .15s;
}
.onb-btn-skip:active { color: var(--t1); }

/* ── "What's Rocky for?" value prop screen ── */
.onb-valueprop {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.onb-valueprop-title {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--t1);
  margin: 0 0 4px;
  text-align: center;
}

.onb-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.onb-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.onb-tile-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.onb-tile-text { flex: 1; min-width: 0; }

.onb-tile-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 2px;
}

.onb-tile-sub {
  font-size: 13px;
  color: var(--t3);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.4;
}

.onb-tile-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── GCal connected state (Google sign-in users) ── */
.onb-gcal-connected {
  display: flex;
  align-items: center;
  gap: 10px;
  background: color-mix(in srgb, #16A34A 10%, var(--surface));
  border: 1.5px solid color-mix(in srgb, #16A34A 25%, var(--border));
  border-radius: 12px;
  padding: 12px 14px;
}

.onb-gcal-connected-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, #16A34A 15%, var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onb-gcal-connected-label {
  font-size: 14px;
  font-weight: 500;
  color: #16A34A;
  font-family: 'DM Sans', sans-serif;
}

.onb-sync-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 2px;
  cursor: pointer;
}

.onb-sync-text { flex: 1; }

.onb-sync-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--t1);
  font-family: 'DM Sans', sans-serif;
}

.onb-toggle-wrap { position: relative; flex-shrink: 0; }

.onb-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.onb-toggle-track {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--border2);
  cursor: pointer;
  transition: background .2s;
  position: relative;
}
.onb-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.onb-toggle-input:checked + .onb-toggle-track {
  background: var(--terra);
}
.onb-toggle-input:checked + .onb-toggle-track::after {
  transform: translateX(18px);
}

.onb-gcal-note {
  font-size: 12px;
  color: var(--t4);
  margin: 0;
  line-height: 1.5;
}

/* ── Find a friend screen ── */
.onb-friend {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.onb-friend-title {
  font-family: 'Lora', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--t1);
  margin: 0;
  text-align: center;
}

.onb-friend-sub {
  font-size: 14px;
  color: var(--t3);
  text-align: center;
  margin: -8px 0 0;
  line-height: 1.5;
}

.onb-search-wrap {
  position: relative;
}

.onb-search-input {
  width: 100%;
  padding: 14px 16px 14px 40px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--t1);
  outline: none;
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239C8E7E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}
.onb-search-input:focus { border-color: var(--terra); }

.onb-search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}

.onb-search-loading,
.onb-search-empty {
  font-size: 13px;
  color: var(--t4);
  text-align: center;
  padding: 12px 0;
}

.onb-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.onb-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onb-result-info { flex: 1; min-width: 0; }

.onb-result-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.onb-result-tag {
  font-size: 12px;
  color: var(--t3);
  font-family: 'DM Sans', sans-serif;
}

.onb-add-btn {
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--terra);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  transition: opacity .15s;
}
.onb-add-btn:active { opacity: .8; }
.onb-add-btn.onb-sent {
  background: var(--bg2);
  color: var(--t3);
  cursor: default;
}

/* ── Fade-in animation for card transitions ── */
@keyframes onbFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.onb-fade-in {
  animation: onbFadeIn .25s ease both;
}
