/* ============================================================
   PPP Checksum Calculator — Nuvei-Inspired Theme
   Design tokens sourced from nuvei.com (June 2026)
   ============================================================ */

/* ---------- Google Fonts import (closest web-safe match) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=Source+Serif+4:wght@600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --core-navy:       #160850;
  --core-navy-80:    #443872;
  --signal-blue:     #0c98d4;
  --warm-white:      #faf9f8;
  --sand-grey:       #f1efed;
  --support-grey:    #cfc9c2;
  --green:           #71ba05;
  --red:             #f83133;
  --text-dark:       #081f2c;
  --text-mid:        #3e4d55;
  --text-muted:      #6b778c;

  --radius-sm:       0.375rem;
  --radius-md:       0.5rem;
  --radius-lg:       0.75rem;
  --radius-xl:       1rem;
  --radius-pill:     3rem;

  --shadow-card:     0 4px 8px -2px rgba(8,31,44,.10), 0 -2px 4px rgba(8,31,44,.06);
  --shadow-input:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:       0 20px 24px -4px rgba(0,0,0,.08), 0 8px 8px -4px rgba(0,0,0,.03);

  --font-heading:    'Source Serif 4', 'Georgia', serif;
  --font-body:       'Inter Tight', 'Arial', sans-serif;

  --max-width:       820px;
  --section-gap:     1.25rem;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--sand-grey);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--signal-blue);
  word-wrap: break-word;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Page wrapper ---------- */
#content {
  max-width: var(--max-width);
  margin: 2rem auto 3rem;
  padding: 0 1rem;
  display: block;
  clear: both;
  background: transparent;
}

/* ---------- Logo / Header ---------- */
#logo {
  width: 100%;
  max-width: var(--max-width);
  min-height: 90px;
  background-color: var(--core-navy) !important;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  border-radius: var(--radius-xl);
  margin-bottom: var(--section-gap);
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem;
}

#environemnt-holder {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm-white);
  background: var(--red);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.65rem;
  line-height: 1.6;
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
}

/* ---------- Fieldset cards ---------- */
.fieldset {
  background: #ffffff;
  border: 1px solid var(--support-grey);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem 1rem;
  margin: 0 auto var(--section-gap);
  max-width: 100%;
  box-shadow: var(--shadow-card);
  position: relative;
}

legend {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--core-navy);
  letter-spacing: 0.01em;
  padding: 0 0.4rem;
  /* fieldset legends are inline — pull them into the card header look */
}

/* ---------- Form rows ---------- */
div[id^="div-"],
div[id^="URL"],
div[id^="additem"] {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
  max-width: 100%;
}

/* ---------- Labels ---------- */
label {
  clear: none;
  display: inline-block;
  float: none;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-mid);
  letter-spacing: 0.02em;
  width: 10em;
  min-width: 10em;
  flex-shrink: 0;
}

/* ---------- Inputs ---------- */
input[type="text"],
input[type="url"],
input[type="number"] {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dark);
  background: var(--warm-white);
  border: 1px solid var(--support-grey);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  height: 2rem;
  box-shadow: var(--shadow-input);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  flex: 1 1 auto;
  min-width: 0;
}

input[type="text"]:focus,
input[type="url"]:focus {
  border-color: var(--signal-blue);
  box-shadow: 0 0 0 3px rgba(12,152,212,.18);
}

input[readonly] {
  background: var(--sand-grey);
  color: var(--text-muted);
  cursor: default;
}

/* ---------- Selects ---------- */
select {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dark);
  background: var(--warm-white);
  border: 1px solid var(--support-grey);
  border-radius: var(--radius-pill);
  padding: 0.35rem 2rem 0.35rem 0.85rem;
  height: 2rem;
  box-shadow: var(--shadow-input);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b778c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}

select:focus {
  border-color: var(--signal-blue);
  box-shadow: 0 0 0 3px rgba(12,152,212,.18);
}

/* ---------- Spans that wrap inputs ---------- */
span[id^="span-"] {
  display: contents;
}

/* ---------- Buttons — primary ---------- */
button {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--core-navy);
  color: var(--warm-white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 1.2rem;
  height: 2rem;
  min-width: 90px;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  flex-shrink: 0;
}

button:hover {
  background: var(--signal-blue);
  box-shadow: 0 6px 18px rgba(12,152,212,.30);
}

button:active {
  transform: translateY(1px);
}

/* ---------- Remove / X buttons ---------- */
.remove {
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-pill);
  width: 1.6rem;
  height: 1.6rem;
  min-width: unset;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  float: none;
}

.remove:hover {
  background: #c0191c;
}

/* ---------- Bottom action buttons bar ---------- */
#buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 1.25rem 0;
}

#buttons button {
  min-width: 130px;
  height: 2.4rem;
  font-size: 0.85rem;
}

/* ---------- Add Item / Remove Item row ---------- */
#additem {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

/* ---------- Tooltip ---------- */
span.tooltip {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  cursor: help;
}

div#tooltip {
  width: 200px;
  position: fixed;
  right: auto;
  background: var(--core-navy);
  color: var(--warm-white);
  font-size: 0.75rem;
  line-height: 1.5;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
}

/* ---------- iFrame overlay ---------- */
#iframe-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 400px;
  min-height: 300px;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 64px -12px rgba(0,0,0,.22);
  z-index: 200;
  padding: 1.25rem;
}

#iframe-dimenstions {
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

#iframe-dimenstions input[type="text"] {
  width: 5rem;
  min-width: 0;
  flex: 0 0 auto;
}

#close {
  margin-top: 0.75rem;
  background: var(--core-navy-80);
}

/* ---------- QR code div ---------- */
div#QRcodeDiv {
  text-align: center;
  margin-top: 0.5rem;
}

iframe#qriframe {
  border: none;
  border-radius: var(--radius-md);
}

/* ---------- Result link area ---------- */
#sc-cs-footerCash {
  margin-top: 0.5rem;
}

#sc-cs-footerCash a {
  font-weight: 600;
  color: var(--signal-blue);
  word-break: break-all;
}

/* ---------- Version/Encoding row ---------- */
#div-version-select,
#div-encoding {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

/* ---------- Scrollbar (WebKit) ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sand-grey); }
::-webkit-scrollbar-thumb { background: var(--support-grey); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--signal-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  #content { padding: 0 0.75rem; }

  label {
    width: 100%;
    min-width: unset;
    margin-bottom: 0.1rem;
  }

  div[id^="div-"],
  div[id^="URL"] {
    flex-direction: column;
    align-items: flex-start;
  }

  input[type="text"],
  input[type="url"],
  select {
    width: 100%;
  }

  #iframe-wrap {
    min-width: 90vw;
    left: 5vw;
    transform: translateY(-50%);
  }
}
