/* =========================================================
   RIH DIL — Single Transfer Builder
   Page CSS only
   Uses global foundation from style.css
   IMPORTANT:
   - Do not redefine .rih-btn / .rih-btn-primary / .rih-btn-ghost
   - Keep step spacing visually consistent on desktop and mobile
   ========================================================= */

/* =========================================================
   HELPERS
   ========================================================= */

.rih-single-transfer-hero{
  margin-bottom: 18px;
}

.rih-single-transfer-muted{
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--rih-text-soft, #5b6b85);
}

.rih-bt-card .rih-single-transfer-muted{
  margin-top: 6px;
}

.rih-bt-card{
  min-height: 120px;
  transition:
    border-color .28s ease,
    box-shadow .28s ease,
    background .28s ease,
    transform .28s ease,
    opacity .28s ease;
}

/* Shared inner content spacing for all step bodies */
.rih-st-size-grid,
.rih-st-qty-wrap,
.rih-st-preview-wrap{
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 18px;
  box-sizing: border-box;
}

/* =========================================================
   STEP 1 — SIZE SELECTOR
   ========================================================= */

.rih-st-size-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.rih-st-size-btn{
  appearance: none;
  width: 100%;
  min-height: 56px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(37,99,235,.16);
  background: #f8fbff;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition:
    border-color .18s ease,
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease,
    color .18s ease;
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
}

.rih-st-size-btn:hover{
  border-color: rgba(37,99,235,.34);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37,99,235,.10);
}

.rih-st-size-btn:focus-visible{
  outline: 2px solid rgba(37,99,235,.28);
  outline-offset: 2px;
}

.rih-st-size-btn.is-active{
  border-color: rgba(37,99,235,.52);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.98) 0%,
    rgba(239,246,255,.96) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(96,165,250,.18),
    0 14px 30px rgba(37,99,235,.12);
  color: #1d4ed8;
  transform: translateY(-2px);
}

/* =========================================================
   STEP 2 — QUANTITY + PRICING
   ========================================================= */

.rih-st-qty-wrap{
  padding-top: 18px;
}

.rih-st-qty-label{
  display: inline-block;
  margin-bottom: 10px;
  color: #1e3a8a;
  font-size: 16px;
  font-weight: 700;
}

.rih-st-qty-input{
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(37,99,235,.16);
  background: #f8fbff;
  color: #0f172a;
  font-size: 18px;
  font-weight: 600;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background .18s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.rih-st-qty-input:hover{
  border-color: rgba(37,99,235,.30);
  background: #ffffff;
}

.rih-st-qty-input:focus{
  outline: none;
  border-color: rgba(37,99,235,.56);
  box-shadow:
    0 0 0 3px rgba(96,165,250,.18),
    0 8px 18px rgba(37,99,235,.08);
  background: #ffffff;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
  opacity: .8;
}

.rih-st-price-box{
  margin-top: 16px;
  padding: 14px 14px;
  border: 1px solid rgba(37,99,235,.14);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.98) 0%,
    rgba(245,249,255,.98) 100%
  );
  box-sizing: border-box;
  box-shadow:
    0 14px 34px rgba(15,23,42,.06),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.rih-st-price-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.rih-st-price-row:last-child{
  margin-bottom: 0;
}

.rih-st-price-k{
  font-size: 14px;
  color: #5b6b85;
  opacity: 1;
}

.rih-st-price-v{
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  white-space: nowrap;
}

#rih-st-total-price{
  font-size: 18px;
  font-weight: 800;
  color: #1d4ed8;
  text-shadow: none;
}

.rih-st-qty-help{
  margin-top: 14px;
}

.rih-st-tier-nudge{
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed rgba(37,99,235,.24);
  border-radius: 12px;
  background: rgba(239,246,255,.88);
  color: #1e40af;
  font-size: 14px;
  line-height: 1.5;
}

/* =========================================================
   STEP 3 — UPLOAD
   ========================================================= */

#rih-st-upload-zone .rih-st-upload-shell,
#rih-st-upload-zone .rih-st-upload-shell-body{
  width:100%;
  max-width:none;
  min-width:0;
  box-sizing:border-box;
}

#rih-st-upload-zone .rih-st-upload-shell-body{
  padding-top: 18px;
}

.rih-st-upload-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.rih-st-upload-preview{
  margin-top:14px;
  padding:12px;
  border:1px dashed rgba(37,99,235,.24);
  border-radius:12px;
  background: rgba(248,251,255,.92);
  min-height:84px;
  box-sizing:border-box;
}

.rih-st-upload-file{
  display: flex;
  align-items: center;
  gap: 14px;
}

.rih-st-upload-thumb{
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(37,99,235,.14);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
}

.rih-st-upload-thumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rih-st-upload-meta{
  min-width: 0;
}

.rih-st-upload-name{
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.rih-st-upload-info{
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

/* uploaded artwork card */

.rih-st-artwork-card{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.rih-st-artwork-left{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.rih-st-artwork-thumb{
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(37,99,235,.14);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15,23,42,.05);
}

.rih-st-artwork-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rih-st-artwork-meta{
  min-width: 0;
}

.rih-st-artwork-name{
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
}

.rih-st-artwork-sub,
.rih-st-artwork-line{
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: #5b6b85;
  word-break: break-word;
}

.rih-st-artwork-dot{
  margin: 0 6px;
  opacity: .55;
}

.rih-st-artwork-right{
  flex: 0 0 auto;
}

.rih-st-artwork-remove{
  min-width: 120px;
}

/* =========================================================
   STEP 4 — PREVIEW
   ========================================================= */

.rih-st-preview-wrap{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 18px;
}

.rih-st-preview-stage{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.98) 0%,
    rgba(245,249,255,.96) 100%
  );
  border: 1px solid rgba(37,99,235,.12);
  box-shadow:
    0 18px 40px rgba(15,23,42,.06),
    inset 0 1px 0 rgba(255,255,255,.8);
  box-sizing: border-box;
}

.rih-st-preview-boundary{
  position: relative;
  width: min(100%, 520px);
  min-height: 120px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(37,99,235,.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(239,246,255,.94)),
    repeating-conic-gradient(
      from 45deg,
      rgba(37,99,235,.028) 0% 25%,
      transparent 0% 50%
    ) 50% / 24px 24px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.7),
    0 18px 40px rgba(37,99,235,.08);
}

.rih-st-preview-safe{
  position: absolute;
  inset: 8%;
  z-index: 2;
  pointer-events: none;
  border: 2px dashed rgba(37,99,235,.42);
  border-radius: 10px;
}

.rih-st-preview-art{
  display:none;
  opacity:0;
  visibility:hidden;
  position:relative;
  z-index:1;
  max-width:86%;
  max-height:86%;
  width:auto !important;
  height:auto !important;
  object-fit:cover;
  object-position:center;
  border-radius:10px;
  box-shadow:0 18px 40px rgba(15,23,42,.16);
}

.rih-st-preview-boundary[data-preview-mode="fit"] .rih-st-preview-art{
  object-fit: contain;
}

.rih-st-preview-boundary[data-preview-mode="crop"] .rih-st-preview-art{
  object-fit: cover;
}

.rih-st-preview-art[hidden]{
  display: none !important;
}

.rih-st-preview-empty{
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #5b6b85;
  font-size: 14px;
  line-height: 1.5;
  pointer-events: none;
}

.rih-st-preview-meta{
  width: min(100%, 520px);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

#rih-st-preview-size-label{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.18);
  background: rgba(239,246,255,.96);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37,99,235,.08);
}

.rih-st-preview-quality{
  padding-top: 8px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

.rih-st-preview-quality.is-excellent{
  color: #15803d;
}

.rih-st-preview-quality.is-good{
  color: #3b82f6;
}

.rih-st-preview-quality.is-fair{
  color: #b45309;
}

.rih-st-preview-quality.is-low{
  color: #dc2626;
}

.rih-st-preview-note{
  flex: 1 1 100%;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  opacity: 1;
}

/* =========================================
STEP PROGRESS HIGHLIGHT
========================================= */

.rih-bt-card.is-active{
  border-color: rgba(37,99,235,.24);
  box-shadow:
    0 0 0 1px rgba(96,165,250,.12),
    0 18px 40px rgba(37,99,235,.10);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,.99) 0%,
    rgba(247,250,255,.98) 100%
  );
}

.rih-bt-card.is-complete{
  border-color: rgba(37,99,235,.16);
  opacity: 1;
}

/* =========================================
STEP CHECKMARKS
========================================= */

.rih-bt-card .rih-bt-step{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.rih-bt-card .rih-bt-step-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:999px;
  background: rgba(37,99,235,.10);
  border:1px solid rgba(37,99,235,.22);
  color:#1d4ed8;
  font-size:11px;
  font-weight:800;
  line-height:1;
  opacity:0;
  transform:scale(.7);
  transition:
    opacity .22s ease,
    transform .22s ease,
    background .22s ease,
    border-color .22s ease;
}

.rih-bt-card.is-complete .rih-bt-step-check{
  opacity:1;
  transform:scale(1);
  animation:rihStepCheckPop .28s ease;
}

@keyframes rihStepCheckPop{
  0%{
    transform:scale(.55);
  }
  60%{
    transform:scale(1.12);
  }
  100%{
    transform:scale(1);
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px){

  /* shared mobile inner spacing */
  .rih-st-size-grid,
  .rih-st-qty-wrap,
  #rih-st-upload-zone .rih-bt-filecard-body,
  .rih-st-preview-wrap{
    padding-left:14px;
    padding-right:14px;
    padding-bottom:14px;
  }

  /* STEP 1 */
  .rih-st-size-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
    padding-top:14px;
  }

  .rih-st-size-btn{
    min-height:58px;
    padding:14px 10px;
  }

  /* STEP 2 */
  .rih-st-qty-wrap{
    padding-top:14px;
  }

  .rih-st-price-row{
    align-items:flex-start;
  }

  .rih-st-price-v{
    text-align:right;
  }

  /* STEP 3 */
  #rih-st-upload-zone,
  #rih-st-upload-zone .rih-st-upload-shell,
  #rih-st-upload-zone .rih-st-upload-shell-body{
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  #rih-st-upload-zone .rih-st-upload-shell-body{
    display:block;
    padding-top:14px;
  }

  #rih-st-upload-zone .rih-single-transfer-muted{
    display:block;
    width:100%;
    max-width:none;
    margin:0 0 14px 0;
    font-size:16px;
    line-height:1.6;
    white-space:normal;
    word-break:normal;
    overflow-wrap:break-word;
  }

  .rih-st-upload-actions{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:12px;
    margin-top:0;
  }

  .rih-st-upload-actions .rih-btn{
    width:100%;
  }

  .rih-st-upload-preview{
    margin-top:14px;
    padding:14px;
    width:100%;
    box-sizing:border-box;
  }

  #rih-st-upload-zone #rih-preset-gallery{
    margin-top:14px;
    width:100%;
    box-sizing:border-box;
  }

  #rih-st-upload-zone .rih-dl__grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .rih-st-artwork-card{
    flex-direction:column;
    align-items:stretch;
    gap:14px;
  }

  .rih-st-artwork-left{
    flex-direction:column;
    gap:12px;
  }

  .rih-st-artwork-thumb{
    width:100%;
    max-width:140px;
    height:auto;
    aspect-ratio:1 / 1;
  }

  .rih-st-artwork-name,
  .rih-st-artwork-sub,
  .rih-st-artwork-line{
    overflow-wrap:anywhere;
    word-break:break-word;
  }

  .rih-st-artwork-right,
  .rih-st-artwork-remove{
    width:100%;
  }

  /* STEP 4 */
  .rih-st-preview-wrap{
    padding-top:14px;
  }

  .rih-st-preview-stage{
    padding:14px;
  }

  .rih-st-preview-boundary{
    width:100%;
    min-height:160px;
    border-radius:14px;
  }

  .rih-st-preview-safe{
    inset:10%;
  }

  .rih-st-preview-empty{
    padding:18px;
    font-size:15px;
  }

  .rih-st-preview-meta{
    width:100%;
    gap:10px;
  }

  #rih-st-preview-size-label{
    min-height:40px;
  }

  .rih-st-preview-quality{
    padding-top:0;
    font-size:15px;
    line-height:1.5;
  }

  .rih-st-preview-note{
    font-size:13px;
    line-height:1.5;
  }
}