/* ═══════════════════════════════════════
   GROUP FORM — Multi-step Wizard + Live Preview
   Reverse Palette (White BG) · Fluid em/rem
   ═══════════════════════════════════════ */

/* ── Reset ── */
.gf-body *,
.gf-body *::before,
.gf-body *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ── */
.gf-body {
  font-family:
    'Roobert Pro',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #ffffff;
  color: #0a0a0a;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ═══ NAV (shared with groups page) ═══ */
.gf-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  backdrop-filter: blur(0.75rem);
  -webkit-backdrop-filter: blur(0.75rem);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 0.0625rem solid rgba(0, 0, 0, 0.06);
}

.gf-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.25rem 2rem;
}

.gf-nav__logo {
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  text-decoration: none;
}

.gf-nav__links {
  display: flex;
  gap: 2rem;
}

.gf-nav__link {
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(10, 10, 10, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.gf-nav__link:hover {
  color: #0a0a0a;
}

/* ═══ LAYOUT — Two-column: form + preview ═══ */
.gf-layout {
  display: grid;
  grid-template-columns: 1fr 24rem;
  gap: 3rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
  align-items: start;
}

/* ═══ FORM PANEL ═══ */
.gf-form-panel {
  max-width: 40rem;
}

.gf-page-title {
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.gf-page-subtitle {
  font-size: 1rem;
  color: rgba(10, 10, 10, 0.5);
  margin-bottom: 2.5rem;
}

/* ── Step Progress ── */
.gf-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
}

.gf-step-indicator {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 0.125rem solid rgba(10, 10, 10, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(10, 10, 10, 0.35);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  background: #fff;
  flex-shrink: 0;
}

.gf-step-indicator.active {
  border-color: #0a0a0a;
  color: #fff;
  background: #0a0a0a;
}

.gf-step-indicator.completed {
  border-color: #0a0a0a;
  color: #0a0a0a;
  background: #fff;
}

.gf-step-label {
  display: block;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  margin-top: 0.375rem;
  color: rgba(10, 10, 10, 0.4);
}

.gf-step-indicator.active .gf-step-label {
  color: #0a0a0a;
}

.gf-step-connector {
  flex: 1;
  height: 0.125rem;
  background: rgba(10, 10, 10, 0.1);
  transition: background 0.3s;
}

.gf-step-connector.completed {
  background: #0a0a0a;
}

/* ── Step Content ── */
.gf-step-content {
  display: none;
}

.gf-step-content.active {
  display: block;
}

.gf-step-title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.gf-step-subtitle {
  font-size: 0.875rem;
  color: rgba(10, 10, 10, 0.5);
  margin-bottom: 2rem;
}

/* ── Form Fields ── */
.gf-field {
  margin-bottom: 1.5rem;
}

.gf-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: #0a0a0a;
}

.gf-label .optional {
  font-weight: 400;
  color: rgba(10, 10, 10, 0.4);
}

.gf-input,
.gf-textarea,
.gf-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 0.0625rem solid rgba(10, 10, 10, 0.15);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  color: #0a0a0a;
  background: #fff;
  transition: all 0.2s;
}

.gf-input:focus,
.gf-textarea:focus,
.gf-select:focus {
  outline: none;
  border-color: #0a0a0a;
  box-shadow: 0 0 0 0.1875rem rgba(10, 10, 10, 0.06);
}

.gf-input::placeholder,
.gf-textarea::placeholder {
  color: rgba(10, 10, 10, 0.3);
}

/* ── Custom Dropdown ── */
.gf-dropdown {
  position: relative;
  width: 100%;
}
.gf-dropdown__toggle {
  width: 100%;
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
  border: 0.0625rem solid rgba(10, 10, 10, 0.15);
  border-radius: 0;
  font-size: 1rem;
  font-family: inherit;
  color: #0a0a0a;
  background: #fff;
  text-align: left;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230a0a0a' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  transition: border-color 0.2s;
}
.gf-dropdown__toggle:focus {
  outline: none;
  border-color: #0a0a0a;
}
.gf-dropdown.is--open .gf-dropdown__toggle {
  border-color: #0a0a0a;
}
.gf-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 0.0625rem solid rgba(10, 10, 10, 0.15);
  border-top: none;
  max-height: 15rem;
  overflow-y: auto;
}
.gf-dropdown.is--open .gf-dropdown__menu {
  display: block;
}
.gf-dropdown__item {
  padding: 0.5rem 0.875rem;
  font-size: 1rem;
  color: #0a0a0a;
  cursor: pointer;
  transition: background 0.15s;
}
.gf-dropdown__item:hover {
  background: #f0f0f0;
}
.gf-dropdown__item.is--selected {
  font-weight: 600;
}

.gf-textarea {
  min-height: 6.25rem;
  resize: vertical;
}

.gf-hint {
  font-size: 0.75rem;
  color: rgba(10, 10, 10, 0.4);
  margin-top: 0.25rem;
}

.gf-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Cover Image Upload ── */
.gf-upload-zone {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0.125rem dashed rgba(10, 10, 10, 0.15);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.02);
}

.gf-upload-zone:hover {
  border-color: rgba(10, 10, 10, 0.3);
  background: rgba(10, 10, 10, 0.04);
}

.gf-upload-zone.has-image {
  border-style: solid;
  border-color: rgba(10, 10, 10, 0.1);
}

.gf-upload-placeholder {
  text-align: center;
  color: rgba(10, 10, 10, 0.4);
}

.gf-upload-placeholder__icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.gf-upload-placeholder__text {
  font-size: 0.875rem;
}

.gf-upload-placeholder__text strong {
  color: #0a0a0a;
}

.gf-upload-preview {
  position: absolute;
  inset: 0;
  display: none;
}

.gf-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gf-upload-preview.active {
  display: block;
}

.gf-upload-actions {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: none;
  gap: 0.5rem;
}

.gf-upload-zone.has-image .gf-upload-actions {
  display: flex;
}

.gf-upload-zone.has-image .gf-upload-placeholder {
  display: none;
}

.gf-upload-btn {
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 0.0625rem solid rgba(10, 10, 10, 0.1);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.gf-upload-btn:hover {
  background: #fff;
}

.gf-upload-btn.danger {
  color: #dc2626;
}

/* ── Privacy Options ── */
.gf-privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.gf-privacy-option {
  border: 0.125rem solid rgba(10, 10, 10, 0.1);
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.gf-privacy-option:hover {
  border-color: rgba(10, 10, 10, 0.25);
}

.gf-privacy-option.active {
  border-color: #0a0a0a;
  background: rgba(10, 10, 10, 0.03);
}

.gf-privacy-option input[type='radio'] {
  display: none;
}

.gf-privacy-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.gf-privacy-label {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gf-privacy-desc {
  font-size: 0.6875rem;
  color: rgba(10, 10, 10, 0.5);
  line-height: 1.3;
}

/* ── Toggle Settings ── */
.gf-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 0.0625rem solid rgba(10, 10, 10, 0.06);
}

.gf-toggle-row:last-child {
  border-bottom: none;
}

.gf-toggle-info {
  flex: 1;
}

.gf-toggle-label {
  font-size: 0.9375rem;
  font-weight: 500;
}

.gf-toggle-desc {
  font-size: 0.75rem;
  color: rgba(10, 10, 10, 0.5);
  margin-top: 0.125rem;
}

.gf-toggle {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.gf-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.gf-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(10, 10, 10, 0.15);
  border-radius: 1.5rem;
  transition: 0.3s;
}

.gf-toggle-slider::before {
  content: '';
  position: absolute;
  height: 1.125rem;
  width: 1.125rem;
  left: 0.1875rem;
  bottom: 0.1875rem;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.gf-toggle input:checked + .gf-toggle-slider {
  background: #0a0a0a;
}

.gf-toggle input:checked + .gf-toggle-slider::before {
  transform: translateX(1.25rem);
}

/* ── Review Summary ── */
.gf-review-section {
  background: rgba(10, 10, 10, 0.02);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.gf-review-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(10, 10, 10, 0.4);
  margin-bottom: 1rem;
}

.gf-review-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.gf-review-label {
  color: rgba(10, 10, 10, 0.5);
}

.gf-review-value {
  font-weight: 500;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.gf-review-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.gf-review-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Navigation Buttons ── */
.gf-step-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 0.0625rem solid rgba(10, 10, 10, 0.06);
}

.gf-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
}

.gf-nav-btn.prev {
  background: transparent;
  color: rgba(10, 10, 10, 0.6);
  border: 0.0625rem solid rgba(10, 10, 10, 0.1);
}

.gf-nav-btn.prev:hover {
  border-color: rgba(10, 10, 10, 0.3);
  color: #0a0a0a;
}

.gf-nav-btn.next {
  background: #0a0a0a;
  color: #fff;
}

.gf-nav-btn.next:hover {
  background: #222;
}

.gf-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #0a0a0a;
  color: #fff;
  transition: all 0.2s;
  font-family: inherit;
}

.gf-submit-btn:hover {
  background: #222;
}

.gf-submit-btn:disabled {
  background: rgba(10, 10, 10, 0.15);
  color: rgba(10, 10, 10, 0.3);
  cursor: not-allowed;
}

/* ── Spacer ── */
.gf-nav-spacer {
  flex: 1;
}

/* ═══ LIVE PREVIEW PANEL ═══ */
.gf-preview-panel {
  position: sticky;
  top: 7rem;
}

.gf-preview-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(10, 10, 10, 0.35);
  margin-bottom: 1rem;
}

/* ── Preview Card (os-card pattern) ── */
.gf-preview-card {
  width: 100%;
  aspect-ratio: 4 / 6;
  font-size: clamp(0.625rem, 1.5vw, 0.875rem);
  border-radius: 0.75em;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0.25rem 1.5rem rgba(0, 0, 0, 0.08);
}

.gf-preview-cover {
  height: 50%;
  background: linear-gradient(135deg, #e5e5e5, #d0d0d0);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gf-preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.gf-preview-cover img.active {
  display: block;
}

.gf-preview-cover__initial {
  font-size: 3em;
  font-weight: 600;
  color: rgba(10, 10, 10, 0.12);
}

.gf-preview-body {
  flex: 1;
  padding: 1.25em;
  display: flex;
  flex-direction: column;
}

.gf-preview-name {
  font-size: 1.25em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
  color: #0a0a0a;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gf-preview-desc {
  font-size: 0.8em;
  line-height: 1.4;
  color: rgba(10, 10, 10, 0.55);
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.gf-preview-meta {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 1em;
}

.gf-preview-badge {
  font-size: 0.7em;
  font-weight: 500;
  padding: 0.3em 0.7em;
  border-radius: 2em;
  background: rgba(10, 10, 10, 0.06);
  color: rgba(10, 10, 10, 0.6);
}

.gf-preview-badge.privacy {
  background: rgba(10, 10, 10, 0.08);
  color: #0a0a0a;
}

.gf-preview-footer {
  padding: 1em 1.25em;
  border-top: 0.0625em solid rgba(10, 10, 10, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gf-preview-action {
  font-size: 0.75em;
  font-weight: 500;
  color: #0a0a0a;
}

.gf-preview-type {
  font-size: 0.65em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(10, 10, 10, 0.35);
}

/* ═══ MESSAGE ═══ */
.gf-message {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.gf-message.success {
  display: block;
  background: #dcfce7;
  color: #166534;
}

.gf-message.error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}

/* ═══ LOADING ═══ */
.gf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.gf-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 0.1875rem solid rgba(10, 10, 10, 0.1);
  border-top-color: #0a0a0a;
  border-radius: 50%;
  animation: gf-spin 0.8s linear infinite;
}

@keyframes gf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══ SUCCESS STATE ═══ */
.gf-success {
  text-align: center;
  padding: 4rem 2rem;
}

.gf-success__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.gf-success__title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.gf-success__text {
  font-size: 0.9375rem;
  color: rgba(10, 10, 10, 0.5);
  margin-bottom: 2rem;
}

.gf-success__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #0a0a0a;
  color: #fff;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.gf-success__link:hover {
  background: #222;
}

/* ═══ INVITE SECTION (in success state) ═══ */
.gf-invite {
  text-align: left;
  max-width: 28rem;
  margin: 0 auto 2rem;
}

.gf-invite__section {
  margin-bottom: 1.25rem;
}

.gf-invite__section:last-child {
  margin-bottom: 0;
}

.gf-invite__row {
  display: flex;
  gap: 0.5rem;
}

.gf-invite__row .gf-input {
  flex: 1;
  min-width: 0;
}

.gf-invite__row .gf-nav-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.gf-invite__msg {
  display: none;
  font-size: 0.8125rem;
  margin-top: 0.375rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
}

.gf-invite__msg.success {
  display: block;
  color: #166534;
  background: #dcfce7;
}

.gf-invite__msg.error {
  display: block;
  color: #991b1b;
  background: #fee2e2;
}

/* ═══ TABLET ═══ */
@media screen and (max-width: 64rem) {
  .gf-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .gf-preview-panel {
    position: static;
    order: -1;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .gf-preview-card {
    max-width: 18rem;
    font-size: clamp(0.5625rem, 2vw, 0.8125rem);
  }

  .gf-form-panel {
    max-width: none;
  }
}

/* ═══ MOBILE ═══ */
@media screen and (max-width: 48rem) {
  .gf-layout {
    padding: 6rem 1rem 3rem;
  }

  .gf-page-title {
    font-size: 1.75rem;
  }

  .gf-nav__inner {
    padding: 1rem;
  }

  .gf-steps {
    margin-bottom: 2rem;
  }

  .gf-step-label {
    display: none;
  }

  .gf-privacy-grid {
    grid-template-columns: 1fr;
  }

  .gf-field-grid {
    grid-template-columns: 1fr;
  }

  .gf-preview-card {
    max-width: 14rem;
  }

  .gf-step-nav {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .gf-nav-btn,
  .gf-submit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ═══ FOOTER ═══ */
.gf-footer {
  border-top: 0.0625rem solid rgba(0, 0, 0, 0.08);
  padding: 3rem 2rem;
}

.gf-footer__inner {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gf-footer__text {
  font-size: 0.875rem;
  font-weight: 400;
  color: #0a0a0a;
}

.gf-footer__text.is--muted {
  color: rgba(10, 10, 10, 0.3);
}
