/* DEXEL pay — tokens follow the "Slate Copper" palette in dexel-website/src/app/globals.css */

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --brand: #c98a66;
  --brand-bright: #dba98b;
  --brand-deep: #b96f47;
  --bg: #172229;
  --bg-deep: #0d1519;
  --card: #1e2c34;
  --heading: #f3eee8;
  --body: #c3ccd0;
  --muted: #98a7ad;
  --hairline: rgb(243 238 232 / 0.1);
  --hairline-strong: rgb(243 238 232 / 0.2);
  --field: rgb(0 0 0 / 0.22);
  --field-focus: rgb(0 0 0 / 0.34);
  --success: #4ade80;
  --error: #f87171;
  --gradient-brand: linear-gradient(120deg, #c27c55 0%, #c98a66 40%, #dba98b 100%);
  --radius: 1rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 16px 40px -24px rgb(0 0 0 / 0.8);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 50% -10%, rgb(201 138 102 / 0.12), transparent 70%),
    var(--bg);
  color: var(--body);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: inherit;
}

.shell {
  width: 100%;
  max-width: 34rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Header ------------------------------------------------------------ */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  padding: 0.25rem 0;
}

.logo {
  display: block;
  height: 1.15rem;
  width: auto;
}

.lang {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--body);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s;
}

.lang:hover,
.lang:focus-visible {
  color: var(--heading);
  border-color: var(--brand);
}

/* Card -------------------------------------------------------------- */

.main {
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.25rem;
}

@media (min-width: 30rem) {
  .card {
    padding: 2.25rem 2rem;
  }
}

h1 {
  margin: 0 0 0.5rem;
  color: var(--heading);
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: 700;
}

.lead {
  margin: 0 0 1.5rem;
}

.alert {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid rgb(248 113 113 / 0.4);
  background: rgb(248 113 113 / 0.08);
  color: #fecaca;
  font-size: 0.925rem;
}

/* Form -------------------------------------------------------------- */

.form {
  display: grid;
  gap: 1.1rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--heading);
  font-size: 0.925rem;
  font-weight: 600;
}

.opt {
  color: var(--muted);
  font-weight: 400;
}

input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 0.6rem;
  border: 1px solid var(--hairline-strong);
  background: var(--field);
  color: var(--heading);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

/* Keep the placeholder/value on the reading side for LTR inputs inside an RTL page. */
[dir="rtl"] input[dir="ltr"] {
  text-align: right;
}

input::placeholder {
  color: var(--muted);
}

input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--field-focus);
  box-shadow: 0 0 0 3px rgb(201 138 102 / 0.2);
}

input[readonly] {
  border-style: dashed;
  cursor: default;
}

.has-error input {
  border-color: var(--error);
}

.money {
  position: relative;
}

/* The input is dir="ltr" even on Arabic pages, so its logical sides don't follow the page —
   pad the side the currency label sits on explicitly. */
.money input {
  padding-right: 3.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

[dir="rtl"] .money input {
  padding-right: 0.95rem;
  padding-left: 3.5rem;
}

.currency {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0.95rem;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
  pointer-events: none;
}

/* Services: a grid of icon tiles over real checkboxes, set apart from the details above. */
.services {
  margin: 0.35rem 0 0;
  padding: 1.25rem 0 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  min-width: 0;
}

.services legend {
  float: inline-start; /* keeps the legend inside the padding, under the divider */
  width: 100%;
  padding: 0;
  color: var(--heading);
  font-size: 0.925rem;
  font-weight: 600;
}

.services .hint {
  clear: both;
  margin: 0.1rem 0 0.85rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (min-width: 30rem) {
  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.tile {
  position: relative;
  display: block;
  cursor: pointer;
}

.tile input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.tile-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  height: 100%;
  min-height: 5.75rem;
  padding: 0.9rem 0.5rem 0.75rem;
  border: 1px solid var(--hairline-strong);
  border-radius: 0.8rem;
  background: var(--field);
  text-align: center;
  pointer-events: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.tile-icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--muted);
  transition: color 0.15s;
}

.tile-label {
  color: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.15s;
}

/* Tick badge in the top corner, filled in when the tile is chosen. */
.tile-check {
  position: absolute;
  top: 0.45rem;
  inset-inline-end: 0.45rem;
  width: 1.1rem;
  height: 1.1rem;
  border: 1.5px solid var(--hairline-strong);
  border-radius: 50%;
  transition: background-color 0.15s, border-color 0.15s;
}

.tile:hover .tile-box {
  border-color: rgb(201 138 102 / 0.5);
}

.tile:hover .tile-icon,
.tile:hover .tile-label {
  color: var(--heading);
}

.tile input:checked + .tile-box {
  border-color: var(--brand);
  background: rgb(201 138 102 / 0.1);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.tile input:checked + .tile-box .tile-icon {
  color: var(--brand);
}

.tile input:checked + .tile-box .tile-label {
  color: var(--heading);
}

.tile input:checked + .tile-box .tile-check {
  border-color: var(--brand);
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5 5.5-6' fill='none' stroke='%23172229' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 75% no-repeat;
}

.tile input:focus-visible + .tile-box {
  outline: 2px solid var(--brand-bright);
  outline-offset: 2px;
}

.hint,
.error {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.hint {
  color: var(--muted);
}

.error {
  color: var(--error);
}

/* Honeypot: off-screen for people, still in the form for bots. */
.hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1.25rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--gradient-brand);
  color: var(--bg);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s, opacity 0.15s;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.brand:focus-visible,
.lang:focus-visible {
  outline: 2px solid var(--brand-bright);
  outline-offset: 3px;
}

.btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn-ghost {
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--hairline-strong);
  font-weight: 600;
}

.btn-ghost:hover {
  border-color: var(--brand);
  filter: none;
}

.btn-danger {
  background: transparent;
  color: #fecaca;
  border: 1px solid rgb(248 113 113 / 0.55);
}

.btn-danger:hover {
  background: rgb(248 113 113 / 0.1);
  filter: none;
}

/* Dashboard state label. */
.pill {
  display: inline-block;
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.pill-on {
  background: rgb(74 222 128 / 0.12);
  color: var(--success);
  border: 1px solid rgb(74 222 128 / 0.35);
}

.pill-off {
  background: rgb(248 113 113 / 0.1);
  color: var(--error);
  border: 1px solid rgb(248 113 113 / 0.35);
}

.note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Status ------------------------------------------------------------ */

.status {
  text-align: center;
}

.badge {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.status-ok .badge {
  background: rgb(74 222 128 / 0.12);
  color: var(--success);
  border: 1px solid rgb(74 222 128 / 0.35);
}

.status-wait .badge {
  background: rgb(201 138 102 / 0.12);
  color: var(--brand);
  border: 1px solid rgb(201 138 102 / 0.35);
}

.status-bad .badge {
  background: rgb(248 113 113 / 0.1);
  color: var(--error);
  border: 1px solid rgb(248 113 113 / 0.35);
}

.summary {
  margin: 0 0 1.5rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 0.75rem;
  background: rgb(0 0 0 / 0.15);
  text-align: start;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}

.summary div + div {
  border-top: 1px solid var(--hairline);
}

.summary dt {
  color: var(--muted);
}

.summary dd {
  margin: 0;
  text-align: end;
  color: var(--heading);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: grid;
  gap: 0.75rem;
}

/* Footer ------------------------------------------------------------ */

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.foot p {
  margin: 0.2rem 0;
}

.methods {
  color: var(--body);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
