/* =============================================
   Arterra — Shared Profile Page Styles
   Requires portal.css to be loaded first.
   ============================================= */

/* ── PROFILE PHOTO ── */
.profile-photo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: var(--accent-light);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'Playfair Display', serif;
  overflow: hidden;
  cursor: pointer;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-upload-overlay {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}

.profile-photo-wrap:hover .photo-upload-overlay { opacity: 1; }

.photo-upload-overlay span {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #FFFFFF;
}

.photo-upload-icon { font-size: 1.125rem; }

.photo-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  line-height: 1.4;
}

/* ── PROFILE HERO ── */
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.profile-hero-info {
  flex: 1;
  min-width: 0;
}

.profile-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.profile-name-input {
  font-family: 'Playfair Display', serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  outline: none;
  letter-spacing: -0.02em;
  padding: 0 0 2px;
  width: 100%;
  max-width: 400px;
  transition: border-color 0.2s;
}

.profile-name-input:focus {
  border-bottom-color: var(--accent);
}

.profile-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-light);
  color: var(--accent);
  white-space: nowrap;
}

.profile-tagline-input {
  font-size: 0.9rem;
  color: var(--text-secondary);
  border: none;
  border-bottom: 1px dashed var(--border);
  background: transparent;
  outline: none;
  width: 100%;
  max-width: 500px;
  padding: 2px 0 2px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

.profile-tagline-input:focus {
  border-bottom-color: var(--accent);
  color: var(--text-primary);
}

.profile-tagline-input::placeholder { color: var(--text-muted); }

.profile-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.profile-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

/* ── PROFILE LAYOUT ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

/* ── FORM FIELDS ── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #FDFCFB;
}

.form-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.form-section-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field.full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
  background: var(--surface);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.55;
}

.form-input-icon {
  position: relative;
}

.form-input-icon .form-input {
  padding-left: 32px;
}

.form-input-icon .input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  pointer-events: none;
}

.form-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── TOGGLE SWITCH ── */
.toggle-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.toggle-group-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: #FDFCFB;
}

.toggle-group-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.toggle-group-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.toggle-item:last-child { border-bottom: none; }
.toggle-item:hover { background: #FAFAF8; }

.toggle-item-body {
  flex: 1;
  min-width: 0;
}

.toggle-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.toggle-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.45;
}

.toggle-status-text {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 5px;
}

.toggle-status-text.on  { color: #166534; }
.toggle-status-text.off { color: var(--text-muted); }

/* The toggle switch itself */
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #D9D4CE;
  border-radius: 24px;
  transition: background 0.2s;
}

.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
}

.toggle-switch input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Toggle item icon badge */
.toggle-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── LOCATION ── */
.location-detect-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
}

.location-detect-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.location-detect-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.location-status {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 6px;
  margin-top: 8px;
  display: none;
}

.location-status.visible { display: block; }
.location-status.success { background: #ECFDF4; color: #166534; }
.location-status.error   { background: #FEF2F2; color: #991B1B; }
.location-status.loading { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── INTEREST TAGS ── */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.interest-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.interest-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.interest-tag.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.interest-tag.selected::before {
  content: '✓ ';
  font-size: 0.75rem;
}

/* ── SOCIAL LINKS ── */
.social-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ── PUBLIC PROFILE PREVIEW ── */
.profile-visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-visibility-badge.live {
  background: #ECFDF4;
  color: #166534;
}

.profile-visibility-badge.draft {
  background: #FFFBEB;
  color: #92400E;
}

/* ── COMPLETION METER ── */
.completion-wrap {
  padding: 16px 18px;
}

.completion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.completion-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.completion-pct {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
}

.completion-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.completion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.completion-item.done { color: #166534; }
.completion-item.todo { color: var(--text-muted); }

/* ── SPACE TYPE SELECTOR ── */
.space-type-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
}
.space-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.stb {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'Inter', system-ui, sans-serif;
}
.stb:hover { border-color: #CCC6BF; background: #F5F2EE; }
.stb.selected { border-color: var(--accent); background: var(--accent-light); }
.stb-icon { font-size: 1.125rem; line-height: 1.2; }
.stb-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); margin-top: 2px; }
.stb-hint { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.35; }
.stb.full-span { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; }
.stb.full-span .stb-label { margin-top: 0; }
.stb.full-span .stb-hint { display: none; }
.space-type-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  display: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; }
  .profile-hero-actions { flex-direction: row; align-items: center; }
}

/* ── NEWSLETTER SIGNUP BLOCK ── */
.newsletter-block {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e8e2dc);
  border-radius: var(--radius, 14px);
  padding: 28px 32px 32px;
  margin-top: 24px;
}

.newsletter-block-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #1c1c1c);
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

.newsletter-embed {
  width: 100%;
}

.newsletter-embed form,
.newsletter-embed input,
.newsletter-embed button,
.newsletter-embed select,
.newsletter-embed textarea {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .newsletter-block {
    padding: 20px 18px 22px;
  }
}
