@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=Poppins:wght@400;600;700&display=swap');

:root{
  --red: #E2001A;
  --red-dark: #B40014;
  --red-tint: #FDEAEA;
  --red-tint-border: #F6C9C9;
  --ink: #222222;
  --gray: #6B6B6B;
  --gray-light: #9B9B9B;
  --row-bg: #FAFAFA;
  --row-border: #ECECEC;
  --green: #1B8A3D;
  --paper: #F3F3F3;
}

*{ box-sizing: border-box; }

html,body{
  margin:0;
  padding:0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Vazirmatn', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body{
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 28px 14px 56px;
}

@media (prefers-reduced-motion: no-preference){
  .plate{ animation: rise .4s ease both; }
  @keyframes rise{
    from{ opacity:0; transform: translateY(8px); }
    to{ opacity:1; transform: translateY(0); }
  }
}
/* ---------- logo ---------- */
.logo{
  display:flex;
  justify-content:center;
  align-items:center;
  direction:ltr;
  gap: 10px;
  margin-bottom:18px;
}
.logo img{
  width:280px;
  max-width:90%;
  height:auto;
  display:block;
}
.logo .ansaldo{
  font-size: 22px;
  font-weight: 600;
  color: var(--gray);
  font-family: 'Poppins', sans-serif;
}
.logo .energia{
  font-size: 22px;
  font-weight: 600;
  color: var(--red);
  font-family: 'Poppins', sans-serif;
}
.logo .divider{
  width: 1.5px;
  height: 22px;
  background: var(--gray-light);
}

/* ---------- the plate (asset card) ---------- */

.plate{
  width:100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 22px;
  border: 2.5px solid var(--red);
  padding: 26px 22px 24px;
  box-shadow: 0 14px 32px -18px rgba(226,0,26,.35);
}

.plate-title{
  text-align:center;
  margin: 4px 0 18px;
}
.plate-title h1{
  margin:0;
  font-size: 21px;
  font-weight: 800;
  color: var(--red);
}
.plate-title p{
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gray);
}

.code-pill-row{
  display:flex;
  justify-content:flex-start;
  margin-bottom: 14px;
}
.code-pill{
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .5px;
  color: var(--red-dark);
  background: var(--red-tint);
  border: 1.5px solid var(--red-tint-border);
  border-radius: 999px;
  padding: 7px 18px;
  direction: ltr;
}

.fields{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.field-row{
  display:flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items:center;
  gap: 14px;
  background: var(--row-bg);
  border: 1px solid var(--row-border);
  border-radius: 14px;
  padding: 13px 16px;
}

.field-value{
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.field-value.code{
  font-family: 'Poppins', sans-serif;
  direction: ltr;
}
.field-value.status{
  color: var(--green);
}

.field-label{
  font-size: 12.5px;
  color: var(--gray-light);
  font-weight: 500;
  white-space: nowrap;
}

.footnote{
  max-width: 460px;
  width:100%;
  text-align:center;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--gray-light);
}
.footnote a{ color: var(--gray-light); }

/* ---------- not-found state ---------- */

.plate.not-found{
  border-color: #9B9B9B;
}
.plate.not-found .plate-title h1{ color: #6B6B6B; }
.nf-body{
  text-align:center;
  padding: 8px 6px 4px;
}
.nf-body p{
  font-size: 13.5px;
  color: var(--gray);
  line-height: 1.9;
  margin: 6px 0 0;
}

/* ---------- generic page card (index / generator) ---------- */

.page-card{
  width:100%;
  max-width: 460px;
  background: #ffffff;
  border: 2.5px solid var(--red);
  border-radius: 22px;
  padding: 26px 24px;
  box-shadow: 0 14px 32px -18px rgba(226,0,26,.35);
}

.page-card h1{
  font-size: 19px;
  margin: 0 0 6px;
  color: var(--red);
  font-weight: 800;
}
.page-card p{
  font-size: 13.5px;
  color: var(--gray);
  line-height: 1.9;
}
.page-card code{
  direction: ltr;
  display:inline-block;
  background: var(--red-tint);
  color: var(--red-dark);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 12.5px;
}

.page-card label{
  display:block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 16px 0 6px;
}

.page-card input{
  width:100%;
  padding: 11px 14px;
  border: 1.5px solid var(--row-border);
  border-radius: 12px;
  font-family: 'Poppins', monospace;
  font-size: 14px;
  direction: ltr;
  text-align: right;
  background: var(--row-bg);
  color: var(--ink);
}
.page-card input:focus{
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--red);
  color: #fff;
  border:none;
  border-radius: 12px;
  font-family: 'Vazirmatn', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor:pointer;
}
.btn:focus-visible{ outline: 2px solid var(--red-dark); outline-offset: 2px; }
.btn:hover{ background: var(--red-dark); }

#qr-result{
  margin-top: 20px;
  text-align:center;
}
#qr-result canvas{
  border: 1.5px solid var(--row-border);
  border-radius: 12px;
  padding: 12px;
  background:#fff;
}
#qr-url{
  margin-top: 10px;
  font-family: 'Poppins', monospace;
  font-size: 12px;
  color: var(--gray);
  direction: ltr;
  word-break: break-all;
}
#qr-download{
  display:inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--red);
  font-weight: 700;
  text-decoration: underline;
}

.example-codes{
  margin-top: 16px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.example-codes a{
  font-family: 'Poppins', monospace;
  font-size: 12px;
  color: var(--red-dark);
  background: var(--red-tint);
  border: 1px solid var(--red-tint-border);
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration:none;
}
/* ---------- Asset Image ---------- */

.asset-image{
    width:100%;
    display:flex;
    justify-content:center;
    margin:18px 0 22px;
}

.asset-image img{
    width:220px;
    height:220px;
    object-fit:contain;
    background:#fff;
    border:1px solid #ECECEC;
    border-radius:18px;
    padding:12px;
    box-shadow:0 8px 18px rgba(0,0,0,.08);
}

