/* goals-common: shared create-goal wizard frame + form pieces (Figma "Goals Desktop"). */

.goals-wizard {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: 960px;
}

.goals-wizard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}

.goals-wizard-back {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: none;
  border: none;
  color: var(--white);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.goals-wizard-back-circle,
.goals-wizard-close {
  width: 40px;
  height: 40px;
  border-radius: 40px;
  background: var(--navy-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goals-wizard-back-circle img {
  display: block;
}

.goals-wizard-close {
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 0;
}

.goals-wizard-progress {
  position: relative;
  height: 4px;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  overflow: hidden;
}

.goals-wizard-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 8px;
  background: #D0AA62;
  transition: width 0.25s ease;
}

.goals-wizard-heading {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.goals-wizard-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.goals-wizard-eyebrow img,
.goals-wizard-eyebrow .gi {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.goals-wizard-title {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
}

.goals-wizard-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: flex-start;
}

/* Loading stand-in for an option grid spans the full width like the grid. */
.goals-wizard-body > .groove-skeleton {
  width: 100%;
}

/* Form steps are 500px wide in Figma; option grids span the full 960px. */
.goals-wizard-body > .goals-field,
.goals-wizard-body > .goals-panel,
.goals-wizard-body > .goals-info-card,
.goals-form {
  width: 100%;
  max-width: 500px;
}

.goals-form {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.goals-wizard-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
}

.goals-btn-primary,
.goals-btn-secondary {
  width: 358px;
  max-width: 100%;
  height: 40px;
  padding: 8px 24px;
  border-radius: 40px;
  border: 1px solid var(--navy-border);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 25px;
  cursor: pointer;
}

.goals-btn-primary {
  background: var(--white);
  color: var(--navy-mid);
}

.goals-btn-primary:disabled {
  opacity: 0.4;
  cursor: default;
}

.goals-btn-secondary {
  background: transparent;
  color: var(--white);
}

/* --- Option tiles --- */

.goals-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.goals-option-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  text-align: left;
  background: var(--navy-card);
  border: 1px solid var(--navy-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(2, 9, 22, 0.35);
  color: var(--white);
  font: inherit;
  cursor: pointer;
}

.goals-option-tile:hover,
.goals-option-tile.selected {
  border-color: var(--gold);
}

.goals-option-icon img,
.goals-option-icon .gi {
  display: block;
  width: 40px;
  height: 40px;
}

.goals-option-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: auto;
}

.goals-option-row > img {
  flex-shrink: 0;
}

.goals-option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.goals-option-eyebrow,
.goals-option-sublabel {
  font-size: 10px;
  line-height: 1.4;
  color: var(--light-gray);
}

.goals-option-label {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
}

/* --- Fields --- */

.goals-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.goals-field label {
  font-size: 14px;
  font-weight: 600;
  line-height: 17px;
}

.goals-input {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 8px;
  border-radius: 8px;
  background: var(--navy-card-secondary);
  border: 1px solid var(--control-border);
}

.goals-input.error {
  border-color: #C96B67;
}

.goals-input img {
  display: block;
  flex-shrink: 0;
}

.goals-input input,
.goals-input select {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: "Geist", sans-serif;
  font-size: 16px;
  line-height: 25px;
}

.goals-input input::placeholder {
  color: var(--light-gray);
}

.goals-select select {
  appearance: none;
  cursor: pointer;
}

.goals-select option {
  background: var(--navy-card-secondary);
}

/* Native month picker: hide Chrome's own calendar glyph (we draw the Figma one) but keep it clickable. */
.goals-input input[type="month"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
}

.goals-field-error {
  font-size: 12px;
  line-height: 1.4;
  color: #C96B67;
}

.goals-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-radius: 12px;
  background: var(--navy-card);
}

.goals-or {
  margin: 0;
  font-size: 16px;
  line-height: 25px;
}

.goals-info-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: 8px;
  background: var(--navy-card);
}

.goals-info-card > img {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 24px;
  object-fit: cover;
}

.goals-info-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.goals-info-detail {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--light-gray);
}

/* --- Reflow (WCAG 1.4.10): desktop (>=1024px) unchanged --- */

@media (max-width: 767.98px) {
  .goals-wizard {
    gap: 32px;
  }

  .goals-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goals-option-tile {
    padding: 16px;
  }
}

@media (max-width: 479.98px) {
  .goals-option-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Month + Year dropdowns where the browser has no native month picker. */
.goals-month-fallback {
  display: flex;
  gap: 8px;
}

.goals-month-fallback .goals-select {
  flex: 1;
}
