/* Customer form finish. Native input/select semantics and validation stay intact. */
:root {
  --field-bg:#081e30;
  --field-border:#365b70;
  --field-hover:#59849a;
  --field-focus:#9aeeff;
  --field-text:#edf6ff;
  --field-placeholder:#a1b6c9;
  --field-ring:0 0 0 4px #43d6ea19;
  --field-radius:14px;
}

:is(.page-shell,.store-drawer,.payment-modal,.cancel-order-dialog) :is(input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"])),textarea,select) {
  box-sizing:border-box;
  min-width:0;
  max-width:100%;
  min-height:48px;
  padding:12px 15px;
  border:1px solid var(--field-border);
  border-radius:var(--field-radius);
  background-color:var(--field-bg);
  color:var(--field-text);
  box-shadow:inset 0 1px 0 #c3eaff08,0 2px 6px #010b1712;
  font-family:inherit;
  font-weight:400;
  line-height:1.5;
  transition:border-color 160ms ease,background-color 160ms ease,box-shadow 160ms ease;
  color-scheme:dark;
}

textarea { width:100%; resize:vertical; }
input::placeholder,textarea::placeholder { color:var(--field-placeholder); opacity:1; }
select { cursor:pointer; }
select:not([multiple]):not([size]),select[size="1"] {
  -webkit-appearance:none;
  appearance:none;
  padding-inline-end:44px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ae5f1' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-size:18px 18px;
  background-position:right 15px center;
}
select[multiple],select[size]:not([size="1"]) { min-height:96px; }
select option,select optgroup { background:#0b2235; color:#edf6ff; }

@media(hover:hover) {
  input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"])):where(:not(:disabled):not([readonly])):hover,
  textarea:where(:not(:disabled):not([readonly])):hover,
  select:where(:not(:disabled)):hover { border-color:var(--field-hover); background-color:#0b263a; }
}

/* Keep a clear keyboard ring rather than relying on a faint glow alone. */
input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"])):focus,
textarea:focus,select:focus { border-color:#76d9e8; box-shadow:var(--field-ring); }
input:focus-visible,textarea:focus-visible,select:focus-visible { outline:2px solid var(--field-focus); outline-offset:3px; }
input[aria-invalid="true"],textarea[aria-invalid="true"],select[aria-invalid="true"] { border-color:#ef9b97; }
input:user-invalid,textarea:user-invalid,select:user-invalid { border-color:#ef9b97; }
input:disabled,textarea:disabled,select:disabled { opacity:.62; cursor:not-allowed; }
input[readonly],textarea[readonly] { color:#becfdf; background-color:#0b2030; }

/* Search and custom Robux amount are compound controls: one continuous surface. */
.market-search,.market-sort,.r3y-commerce-amount-input {
  min-width:0;
  border:1px solid var(--field-border);
  border-radius:var(--field-radius);
  background:linear-gradient(150deg,#0b2538,#071c2b);
  box-shadow:inset 0 1px 0 #c3eaff08,0 3px 10px #010b171a;
  transition:border-color 160ms ease,box-shadow 160ms ease;
}
.market-search { gap:12px; padding-inline:16px; }
.market-search > span { flex:none; color:#7ae9f5; }
.market-search input {
  width:100%;
  min-height:48px;
  padding:11px 0;
  border:0;
  border-radius:8px;
  background:transparent;
  box-shadow:none;
}
.market-sort { gap:12px; padding:0 6px 0 16px; }
.market-sort > span { flex:none; color:#b4c9da; font-size:.68rem; font-weight:600; letter-spacing:.08em; }
.market-sort select {
  flex:1 1 auto;
  width:auto;
  min-width:0;
  min-height:48px;
  padding:11px 36px 11px 10px;
  border:0;
  border-radius:10px;
  background-color:transparent;
  background-position:right 10px center;
  box-shadow:none;
  font-size:.88rem;
  font-weight:550;
  text-align:start;
}
.market-search input:hover,.market-search input:focus,.market-sort select:hover,.market-sort select:focus,
.r3y-commerce-amount-input input:hover,.r3y-commerce-amount-input input:focus { border:0; background-color:transparent; box-shadow:none; }
.market-search:focus-within,.market-sort:focus-within,.r3y-commerce-amount-input:focus-within { border-color:#76d9e8; box-shadow:var(--field-ring); }
.market-search input:focus-visible,.market-sort select:focus-visible,.r3y-commerce-amount-input input:focus-visible { outline-offset:-2px; }
.r3y-commerce-amount-input input { min-height:48px; border:0; background:transparent; box-shadow:none; }

/* Preserve native date/number controls and autofill legibility. */
input[type="date"] { padding-inline-end:12px; }
input[type="number"] { font-variant-numeric:tabular-nums; }
input:-webkit-autofill,input:-webkit-autofill:hover,input:-webkit-autofill:focus {
  -webkit-text-fill-color:#edf6ff;
  caret-color:#edf6ff;
  -webkit-box-shadow:0 0 0 1000px #102d41 inset;
}

/* A polished native file button without changing hidden proof pickers. */
input[type="file"]::file-selector-button {
  min-height:40px;
  margin-inline-end:12px;
  padding:8px 14px;
  border:1px solid #457087;
  border-radius:10px;
  background:#11364b;
  color:#e8f8ff;
  font:inherit;
  cursor:pointer;
}

@media(max-width:640px) {
  /* 16px avoids iOS automatically zooming the page when a field receives focus. */
  input:where(:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"])),textarea,select,
  .market-sort select { font-size:16px; }
  .market-sort { width:100%; justify-content:space-between; }
  .market-sort select { flex:0 1 auto; max-width:calc(100% - 78px); }
}
@media(prefers-reduced-motion:reduce) {
  input,textarea,select,.market-search,.market-sort,.r3y-commerce-amount-input { transition:none; }
}
@media(prefers-contrast:more) {
  :root { --field-border:#7b9bb0; --field-placeholder:#bdcfde; }
  input,textarea,select,.market-search,.market-sort,.r3y-commerce-amount-input { box-shadow:none; }
}
@media(forced-colors:active) {
  input,textarea,select,.market-search,.market-sort,.r3y-commerce-amount-input {
    color:CanvasText;
    background:Canvas;
    border-color:ButtonText;
    box-shadow:none;
  }
  select:not([multiple]):not([size]),select[size="1"] { appearance:auto; background-image:none; padding-inline-end:12px; }
  input:focus-visible,textarea:focus-visible,select:focus-visible { outline-color:Highlight; }
}
