@import url("tokens.css");

.visuallyhidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.page-engrave {
  background: #fff;
}

.engrave-page {
  padding: 0 0 48px;
  background: #fff;
  min-height: 100dvh;
}

.engrave-container {
  max-width: 692px;
  margin: 0 auto;
  padding: 0 22px;
}

.engrave-preview-stage {
  background: var(--apple-bg-alt);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 -22px 0;
  padding: 56px 22px 48px;
}

.engrave-preview-disc {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #f4f4f4 38%, #e8e8ea 72%, #ddd 100%);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -8px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.engrave-preview-disc.has-value {
  transform: scale(1.02);
}

.engrave-preview-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 28px;
  text-align: center;
  user-select: none;
  color: #86868b;
}

.engrave-preview-value.is-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #86868b;
}

.engrave-preview-value svg {
  width: 52px;
  height: 52px;
  stroke: #86868b;
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.engrave-preview-value svg .svg-solid {
  fill: #86868b;
  stroke: none;
}

.engrave-preview-value.is-multi {
  gap: 2px;
  flex-wrap: wrap;
}

.engrave-preview-value.is-multi svg {
  width: 36px;
  height: 36px;
}

.engrave-preview-char {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #86868b;
}

.engrave-field-wrap {
  padding: 28px 0 20px;
}

.engrave-field {
  position: relative;
}

.engrave-field-label {
  position: absolute;
  top: 10px;
  left: 16px;
  z-index: 2;
  font-family: var(--font-text);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--apple-text-tertiary);
  pointer-events: none;
  transition: color 0.15s ease;
}

.engrave-field-row {
  position: relative;
}

.engrave-input {
  width: 100%;
  min-height: 56px;
  padding: 26px 44px 12px 16px;
  border: 1px solid var(--apple-border);
  border-radius: 12px;
  font-family: var(--font-text);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--apple-text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  filter: grayscale(1) brightness(0.35);
}

.engrave-input.is-text-entry {
  filter: none;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.engrave-field:focus-within .engrave-field-label {
  color: var(--apple-blue);
}

.engrave-field:focus-within .engrave-input {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
}

.engrave-field:focus-within .engrave-input:not(.is-text-entry) {
  filter: grayscale(1) brightness(0.35);
}

.engrave-field-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--apple-text-tertiary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.engrave-field-clear:hover {
  color: var(--apple-text);
  background: rgba(0, 0, 0, 0.04);
}

.form-selector-group-withgutters {
  border: none;
  margin: 0;
  padding: 0;
}

.row.row-logical {
  display: flex;
  flex-wrap: wrap;
  margin-inline: -6px;
  padding: 0;
}

.column.form-selector-column {
  flex: 0 0 10%;
  max-width: 10%;
  padding: 6px;
  box-sizing: border-box;
}

.form-selector-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.form-selector-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1;
  margin: 0 auto;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.1s ease-out, opacity 0.15s ease;
}

.form-selector-label:hover {
  opacity: 0.72;
}

.form-selector-label:active {
  transform: scale(0.92);
}

.form-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.form-selector-label svg {
  width: 28px;
  height: 28px;
  stroke: var(--apple-text);
  fill: none;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-selector-label svg .svg-solid {
  fill: var(--apple-text);
  stroke: none;
}

.form-selector-input:checked + .form-selector-label .form-icon-wrap {
  background: transparent;
}

.form-selector-input:focus-visible + .form-selector-label {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
}

.form-selector-label.is-number .form-icon-wrap {
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 500;
  color: var(--apple-text);
  border: 1.5px solid var(--apple-text);
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

.form-selector-input:checked + .form-selector-label.is-number .form-icon-wrap {
  background: var(--apple-text);
  color: #fff;
}

.engrave-pages {
  min-height: 240px;
}

.engrave-page-panel {
  display: none;
}

.engrave-page-panel.is-active {
  display: block;
}

.engrave-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 28px;
  padding: 0;
  list-style: none;
}

.engrave-pagination button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #d2d2d7;
  cursor: pointer;
}

.engrave-pagination button[aria-current="true"] {
  background: var(--apple-text);
}

.engrave-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-bottom: 32px;
}

.btn-engrave-save {
  width: 100%;
  min-height: 48px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--apple-blue);
  color: #fff;
  font-family: var(--font-text);
  font-size: 17px;
  cursor: pointer;
}

.btn-engrave-save:hover {
  background: var(--apple-blue-hover);
}

.engrave-cancel {
  font-size: 14px;
  color: var(--apple-link);
  text-decoration: none;
}

.engrave-cancel:hover {
  text-decoration: underline;
}

@media only screen and (max-width: 734px) {
  .column.form-selector-column {
    flex: 0 0 20%;
    max-width: 20%;
  }

  .engrave-preview-stage {
    min-height: 280px;
  }

  .engrave-preview-disc {
    width: 196px;
    height: 196px;
  }
}
