:root {
  --green: #054239;
  --green-deep: #002623;
  --gold: #b9a779;
  --gold-deep: #988561;
  --white: #f7f4ed;
  --ink: #111614;
  --accent: #b9a779;
  --shadow: rgba(0, 38, 35, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(185, 167, 121, 0.35), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(5, 66, 57, 0.35), transparent 50%),
    linear-gradient(140deg, #054239 0%, #b9a779 45%, #002623 75%, #988561 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.flag-sky {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.8), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.7), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(255, 255, 255, 0.6), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.flag-band {
  position: fixed;
  left: 0;
  right: 0;
  height: 33.34vh;
  z-index: 1;
  opacity: 0.9;
}

.flag-band--green {
  top: 0;
  background: linear-gradient(90deg, #054239, #0d5b4d);
}

.flag-band--white {
  top: 33.34vh;
  background: linear-gradient(90deg, #f7f4ed, #efe6d2);
  display: grid;
  place-items: center;
}

.flag-band--black {
  top: 66.68vh;
  background: linear-gradient(90deg, #0a0a0a, #161616);
}

.stars {
  display: flex;
  gap: 1.8rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: #a9342a;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.page {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
  padding: 6rem 1.5rem 3rem;
}

.hero {
  text-align: right;
  color: var(--gold);
  margin-bottom: 2.5rem;
}

.hero__banner {
  background: linear-gradient(120deg, #054239, #002623);
  border-radius: 24px;
  padding: 2rem 2.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.hero__content {
  max-width: 560px;
}

.hero__row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.lang-control {
  margin-top: 0;
  max-width: 220px;
}

.field__inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.select-inline {
  min-width: 160px;
}

.rate-source {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-weight: 700;
  margin-top: 0.6rem;
}

.custom-rate {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.8rem;
  max-width: 520px;
}

.custom-rate__group {
  display: grid;
  gap: 0.6rem;
}

.custom-rate__row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.8rem;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  border: none;
  direction: ltr;
}

.custom-rate__row input {
  min-width: 0;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #d7d1c7;
  font-size: 1rem;
  background: #fffaf2;
}

.custom-rate__row select {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #d7d1c7;
  font-size: 1rem;
  background: #fffaf2;
}

.switch--inline {
  white-space: nowrap;
}

body.ltr {
  direction: ltr;
}

body.ltr .hero,
body.ltr .panel {
  text-align: left;
}

body.ltr .results__grid,
body.ltr .grid,
body.ltr .note-grid {
  direction: ltr;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  background: rgba(185, 167, 121, 0.2);
  border: 1px solid rgba(185, 167, 121, 0.45);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}

.hero h1 {
  margin: 0.8rem 0 0.6rem;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.hero p {
  margin: 0;
  font-size: 1.05rem;
  max-width: 640px;
  line-height: 1.8;
  color: rgba(185, 167, 121, 0.85);
}

.hero__eagle {
  width: min(220px, 35vw);
  height: min(220px, 35vw);
  background: url("assets/eagle.jpg") center/contain no-repeat;
  flex-shrink: 0;
}

.panel {
  background: rgba(247, 244, 237, 0.92);
  border-radius: 18px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 20px 50px rgba(0, 38, 35, 0.25);
  backdrop-filter: blur(6px);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

.subtext {
  margin: 0 0 1.2rem;
  color: #444;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: #2c2c2c;
}

.field input {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #d7d1c7;
  font-size: 1rem;
  background: #fff;
}

.field input[type="file"] {
  padding: 0.55rem 0.7rem;
  background: #fffaf2;
  border-style: dashed;
}

.field--wide {
  margin-top: 1.2rem;
}

.toggle {
  display: inline-flex;
  background: #efe6d2;
  border-radius: 999px;
  padding: 0.3rem;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.toggle--wide {
  justify-content: center;
}

.note-toggle {
  margin: 0.8rem 0 0.2rem;
}

.toggle__btn {
  border: none;
  background: transparent;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  color: #3a2c1d;
  transition: all 0.25s ease;
}

.toggle__btn.is-active {
  background: var(--accent);
  color: #222;
  box-shadow: 0 6px 18px rgba(185, 167, 121, 0.4);
}

.primary {
  margin-top: 1.2rem;
  padding: 0.9rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  background: linear-gradient(120deg, #054239, #b9a779);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 38, 35, 0.3);
}

.primary:hover {
  transform: translateY(-1px);
}

.results__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.result {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e5e0d7;
  text-align: center;
}

.result h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: #444;
}

.result p {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: #1c1d1f;
}

.bulletin {
  margin-top: 1.4rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 1px dashed #d5cbbc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.75);
}

.bulletin h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.bulletin__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.ghost {
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(5, 66, 57, 0.3);
  color: #3a2c1d;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(62, 49, 33, 0.18);
}

.bulletin-panel input[readonly] {
  background: #f4efe4;
  color: #2f2f2f;
  border-style: solid;
}

.notes-panel {
  position: relative;
}

.note-summary {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: #1f2a26;
}

.note-total {
  font-weight: 700;
  color: #2f2f2f;
  margin-bottom: 0.4rem;
}
.note-block {
  margin-top: 1.4rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 38, 35, 0.1);
}

.note-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.note-block__head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.note-select {
  min-width: 180px;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.2rem;
}

.note-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 0.6rem;
}

.note-card {
  padding: 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 38, 35, 0.12);
  display: grid;
  gap: 0.6rem;
  align-items: center;
}

.note-image {
  border-radius: 12px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  letter-spacing: 0.5px;
  background-size: cover;
  background-position: center;
}

.note-image span {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.note-info {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: #2f2f2f;
}

.note-customize {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(0, 38, 35, 0.2);
}

.note-field input {
  text-align: center;
}

.note-error {
  margin-top: 0.5rem;
  color: #8d2f2a;
  font-weight: 600;
}

.note-helper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  position: relative;
}

.note-helper__icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(185, 167, 121, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  border: none;
  font-weight: 700;
  color: inherit;
}

.note-helper__tip {
  position: absolute;
  top: 120%;
  inset-inline-end: 0;
  max-width: 320px;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #fff;
  color: #2a2a2a;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.6;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 38, 35, 0.12);
  z-index: 5;
}

.note-switch {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.switch input {
  width: 18px;
  height: 18px;
}

.split-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.field select {
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #d7d1c7;
  font-size: 1rem;
  background: #fff;
}

.note-old {
  background: linear-gradient(135deg, #6f7a7a, #313a39);
}

.note-usd-100 {
  background-image: url("assets/notes/usd-100.jpg");
}

.note-usd-50 {
  background-image: url("assets/notes/usd-50.jpg");
}

.note-usd-20 {
  background-image: url("assets/notes/usd-20.jpg");
}

.note-usd-10 {
  background-image: url("assets/notes/usd-10.jpg");
}

.note-usd-1 {
  background-image: url("assets/notes/usd-1.jpg");
}

.note-eur {
  background: linear-gradient(135deg, #2f4f7d, #1f2f4a);
}

.note-try {
  background: linear-gradient(135deg, #c94444, #7a2424);
}

.admin-panel__actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.admin-downloads {
  margin-top: 1.2rem;
}

.note-500 {
  background-image: url("assets/notes/500.jpg");
}

.note-200 {
  background-image: url("assets/notes/200.jpg");
}

.note-100 {
  background-image: url("assets/notes/100.jpg");
}

.note-50 {
  background-image: url("assets/notes/50.jpg");
}

.note-25 {
  background-image: url("assets/notes/25.jpg");
}

.note-10 {
  background-image: url("assets/notes/10.jpg");
}

.dashboard__list {
  display: grid;
  gap: 0.8rem;
}

.dashboard__row {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 38, 35, 0.1);
  font-weight: 600;
}

.admin-panel h1,
.dashboard h1 {
  margin-top: 0;
}

.footer {
  text-align: center;
  padding: 1.6rem;
  color: #ffffff;
  font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  width: min(960px, 92%);
  margin: 2rem auto 3rem;
  backdrop-filter: blur(8px);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
  font-weight: 600;
}

.footer__icons {
  display: inline-flex;
  gap: 0.6rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.icon-link {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(185, 167, 121, 0.2);
  color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
  .page {
    padding-top: 5rem;
  }

  .flag-band {
    height: 18vh;
  }

  .flag-band--white {
    top: 18vh;
  }

  .flag-band--black {
    top: 36vh;
  }

  .toggle {
    width: 100%;
    justify-content: center;
  }

  .primary {
    width: 100%;
  }

  .hero__banner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero__content {
    text-align: center;
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.hero {
  animation: floatIn 0.7s ease both;
}
