/* =====================================================================
   Supraja CTF — Challenges & Submit-Flag Pages
   Presentational skin that sits on top of site-theme.css so these two
   page types match the rest of the platform. No functional/behavioural
   rules live here — layout & look only.
   ===================================================================== */

/* ---------------------------------------------------------------
   Page hero header (shared by challeges.html + all submit pages)
--------------------------------------------------------------- */
.page-hero {
  text-align: center;
  padding: 2.75rem 1rem 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}
.page-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--st-cyan);
  background: rgba(18, 214, 240, 0.12);
  border: 1px solid rgba(18, 214, 240, 0.35);
  padding: .4rem 1rem;
  border-radius: 999px;
  margin-bottom: .9rem;
}
.page-hero h1, .page-hero h2 {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  margin-bottom: .5rem;
  text-shadow: 0 0 22px rgba(18, 214, 240, .35);
}
.page-hero .lead-sub {
  color: var(--st-text-dim);
  margin: 0 auto;
  font-size: .98rem;
}

/* ---------------------------------------------------------------
   Challenges grid (challeges.html)
--------------------------------------------------------------- */
.challenge-card {
  padding: 1.6rem 1.5rem !important;
}
.challenge-card-head {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .6rem;
}
.level-icon-badge {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, rgba(18,214,240,0.22), rgba(35,230,163,0.16));
  border: 1px solid rgba(18,214,240,0.35);
  color: var(--st-cyan);
}
.challenge-card h4 {
  margin: 0;
  font-size: 1.1rem;
}
.challenge-card p {
  color: var(--st-text-dim);
  font-size: .92rem;
  min-height: 44px;
}
.challenge-card .btn-custom {
  font-size: .88rem;
}

/* ---------------------------------------------------------------
   Submit-Flag pages
--------------------------------------------------------------- */
.back-to-challenges-wrap {
  /* same width/gutter as Bootstrap's .container, so the button lines up with
     the left edge of the challenge cards instead of sitting in the centre */
  width: 100%;
  margin: 0 auto 1.25rem;
  padding: 0 .75rem;
}
@media (min-width: 576px)  { .back-to-challenges-wrap { max-width: 540px;  } }
@media (min-width: 768px)  { .back-to-challenges-wrap { max-width: 720px;  } }
@media (min-width: 992px)  { .back-to-challenges-wrap { max-width: 960px;  } }
@media (min-width: 1200px) { .back-to-challenges-wrap { max-width: 1140px; } }
@media (min-width: 1400px) { .back-to-challenges-wrap { max-width: 1320px; } }
.btn-back-challenges {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border-radius: 999px !important;
  background: rgba(18,214,240,0.16) !important;
  border: 1px solid rgba(18,214,240,0.55) !important;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 600;
  padding: .65rem 1.5rem !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.btn-back-challenges:hover {
  background: rgba(18,214,240,0.28) !important;
  border-color: rgba(18,214,240,0.8) !important;
  color: #fff !important;
}

.level-card {
  padding: 1.6rem 1.7rem !important;
  margin-bottom: 1.6rem;
}
.level-card-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.level-card-head .level-icon-badge { width: 40px; height: 40px; font-size: 1.05rem; }
.level-card-head h4 {
  margin: 0;
  font-size: 1.05rem;
}

.flag-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.flag-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.flag-row .flag-index {
  flex: 0 0 2.3rem;
  width: 2.3rem;
  height: 2.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  font-size: .74rem;
  font-weight: 600;
  color: var(--st-text-dim);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
}
.flag-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.20);
  color: var(--st-text);
  border-radius: 8px;
  padding: .3rem .75rem;
  font-size: .85rem;
  height: 2.3rem;
  line-height: 1.4rem;
}
.flag-row input[type="text"]::placeholder { color: var(--st-text-dim); }
.flag-row input[type="text"]:focus {
  outline: none;
  border-color: var(--st-cyan);
  box-shadow: 0 0 0 .18rem rgba(18,214,240,0.20);
  background: rgba(255,255,255,0.12);
}
.flag-row input[type="text"]:disabled {
  color: var(--st-text-dim);
  background: rgba(255,255,255,0.04);
}
.btn-flag-submit {
  flex: 0 0 5rem;
  width: 5rem;
  height: 2.3rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  padding: 0 .5rem !important;
  font-size: .8rem;
  font-weight: 600;
  border: none !important;
  background: linear-gradient(135deg, var(--st-mint), var(--st-cyan-2)) !important;
  color: #052318 !important;
}
.btn-flag-submit:disabled {
  opacity: .85;
  background: rgba(35,230,163,0.18) !important;
  color: var(--st-mint) !important;
  box-shadow: none !important;
}
/* Solved rows: one read-only field + a plain "Solved" tag (no second box) */
.flag-solved-badge {
  flex: 0 0 5rem;
  width: 5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--st-mint);
  background: none;
  border: none;
  white-space: nowrap;
}
.flag-row-solved .flag-index {
  color: var(--st-mint);
  border-color: rgba(35,230,163,0.4);
  background: rgba(35,230,163,0.10);
}

.level-card-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}
.btn-hint {
  border-radius: 999px !important;
  background: rgba(255, 193, 7, 0.14) !important;
  border: 1px solid rgba(255, 193, 7, 0.45) !important;
  color: #ffd873 !important;
  font-weight: 600;
  padding: .4rem 1rem !important;
}
.btn-hint:hover { background: rgba(255, 193, 7, 0.24) !important; }

.level-progress-wrap { flex: 1; min-width: 160px; }
.level-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08) !important;
  overflow: hidden;
}
.level-progress-bar {
  background: linear-gradient(90deg, var(--st-cyan), var(--st-mint)) !important;
  font-size: .68rem;
  font-weight: 700;
  line-height: 10px;
}

.hint {
  display: none;
  margin: .9rem 0 0;
  padding: .7rem 1rem;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px dashed rgba(255, 193, 7, 0.4);
  color: #ffd873;
  font-size: .9rem;
}

/* Flag-submission status banner */
.message-box {
  padding: .8rem 1.4rem;
  border-radius: 999px;
  text-align: center;
  margin: 0 auto 1.6rem;
  width: fit-content;
  max-width: 90%;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  animation: fadeIn .4s ease-in-out;
}
.message-success { background: linear-gradient(135deg, var(--st-mint), var(--st-cyan-2)); color: #052318 !important; }
.message-error   { background: linear-gradient(135deg, #ff5f6d, #c0394a); }
.message-warning { background: linear-gradient(135deg, #ffc107, #ff9f1c); color: #23180a !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------
   Responsive
--------------------------------------------------------------- */
@media (max-width: 576px) {
  .flag-row { flex-basis: 100%; max-width: 100%; gap: .4rem; }
  .flag-row .flag-index { flex-basis: 2.1rem; width: 2.1rem; }
  .btn-flag-submit, .flag-solved-badge { flex-basis: 4.4rem; width: 4.4rem; }
  .level-card { padding: 1.25rem !important; }
  .level-card-foot { flex-direction: column; align-items: stretch; }
  .level-progress-wrap { width: 100%; }
}