/* ===========================================================
   Selection Test Results — White Glassmorphism
   OUSL — externalapp (embedded via iframe on a white page)
   =========================================================== */

:root{
  --ink: #1c2530;
  --muted: #5c6572;
  --line: rgba(28,37,48,0.14);

  --glass-bg: rgba(255,255,255,0.55);
  --glass-bg-strong: rgba(255,255,255,0.78);
  --glass-border: rgba(255,255,255,0.85);
  --glass-shadow: 0 30px 60px rgba(31,49,79,0.16), inset 0 1px 2px rgba(255,255,255,0.7);

  --accent-ink: #1d4ed8;

  --selected: #10b981;
  --selected-hover: #059669;

  --not-selected: #ef4444;
  --not-selected-hover: #dc2626;

  --row-bg: rgba(255,255,255,0.45);
  --row-border: rgba(28,37,48,0.08);
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  color: var(--ink);
  background: transparent; /* let the parent page's own white background show through */
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* kept as a hook for the result-active blur transition, but with no colour
   of its own now — the page is plain, the card carries its own shadow */
.backdrop{
  position: fixed;
  inset: -80px;
  z-index: 0;
  pointer-events: none;
  transition: filter 0.5s ease;
  background: transparent;
}
body.result-active .backdrop{
  filter: blur(38px);
}
.blob{
  display: none;
}

.page{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 20px 32px;
}

.glass-panel{
  width: 100%;
  max-width: 860px;
  max-height: calc(100vh - 46px);
  overflow-y: auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 30px 35px;
  animation: panel-in 0.5s ease-out;
  scrollbar-width: thin;
  scrollbar-color: rgba(28,37,48,0.25) transparent;
}
.glass-panel::-webkit-scrollbar{
  width: 8px;
}
.glass-panel::-webkit-scrollbar-thumb{
  background: rgba(28,37,48,0.2);
  border-radius: 8px;
}

@keyframes panel-in{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

.panel-header{
  margin-bottom: 20px;
  text-align: center;
}
.crest{
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  filter: drop-shadow(0 4px 10px rgba(31,49,79,0.25));
}
.kicker{
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.panel-header h1{
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.field-group{
  margin-bottom: 6px;
}
.field-group label{
  display: block;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.glass-select,
.glass-input{
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--glass-bg-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 20px;
  outline: none;
  box-shadow: inset 0 2px 4px rgba(31,49,79,0.06);
  transition: background 0.3s, border-color 0.3s;
  box-sizing: border-box;
}
.glass-select:focus,
.glass-input:focus{
  background: rgba(255,255,255,0.92);
  border-color: rgba(29,78,216,0.35);
}
.glass-select{
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 15px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.glass-select option{
  color: #1c2530;
  background: #ffffff;
}

.exam-info{
  margin-top: 14px;
}
.exam-title{
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--accent-ink);
}
.exam-instruction{
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.exam-instruction--error{
  color: var(--not-selected);
}

.search-row{
  display: flex;
  gap: 15px;
  margin-top: 16px;
}
.search-row .glass-input{
  flex: 1;
}

.btn-primary{
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent-ink);
  background: linear-gradient(135deg, rgba(56,189,248,0.30) 0%, rgba(14,165,233,0.18) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(56,189,248,0.45);
  border-radius: 14px;
  padding: 0 35px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.7),
    inset 0 -1px 2px rgba(14,165,233,0.08),
    0 4px 15px rgba(14,165,233,0.18);
}
.btn-primary:hover{
  background: linear-gradient(135deg, rgba(56,189,248,0.40) 0%, rgba(14,165,233,0.26) 100%);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.8),
    0 6px 20px rgba(14,165,233,0.28);
  transform: translateY(-1px);
}
.btn-primary:active{
  transform: translateY(0);
}

.result-area{
  margin-top: 16px;
}

/* ---- result card (used by both csv_function.php and txt_function.php) ---- */
.result-card{
  background: var(--row-bg);
  border: 1px solid var(--row-border);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 10px;
  overflow: hidden;
}
.result-card.is-selected,
.result-card.is-not-selected,
.result-card.is-neutral{
  background: var(--row-bg);
  border-color: var(--row-border);
}

.status-pill{
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  background: var(--muted);
  color: #fff;
}
.status-pill.is-selected{ background: var(--selected); }
.status-pill.is-not-selected{ background: var(--not-selected); }

.result-rows{
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.result-row{
  display: flex;
  gap: 14px;
  font-size: 14.5px;
  line-height: 1.4;
}
.result-label{
  flex: 0 0 150px;
  color: var(--muted);
  font-weight: 500;
}
.result-value{
  flex: 1;
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}

/* generic value chips — used by txt_function.php when a file's columns
   aren't semantically labelled */
.result-values{
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
}
.result-chip{
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 16px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.result-chip.status-chip{
  color: #ffffff;
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 20px;
  margin-left: auto;
  box-shadow: 0 4px 12px rgba(16,185,129,0.25);
  transition: all 0.2s ease;
}
.result-chip.status-chip.is-selected{ background: var(--selected); }
.result-chip.status-chip.is-selected:hover{ background: var(--selected-hover); }
.result-chip.status-chip.is-not-selected{
  background: var(--not-selected);
  box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.result-chip.status-chip.is-not-selected:hover{ background: var(--not-selected-hover); }

.notice-banner{
  font-size: 13.5px;
  color: #b3261e;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 4px;
}
.notice-banner a{
  color: #b3261e;
  font-weight: 700;
}

@media (max-width: 480px){
  .glass-panel{ padding: 26px 22px; border-radius: 24px; }
  .search-row{ flex-direction: column; }
  .btn-primary{ padding: 14px 20px; }
  .result-label{ flex-basis: 120px; }
}
