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

:root {
  --bg: #040713;
  --bg-2: #0b1523;
  --panel: rgba(12, 24, 38, 0.82);
  --panel-strong: rgba(8, 17, 30, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(25, 183, 198, 0.36);
  --primary: #19b7c6;
  --accent: #d69b3a;
  --violet: #6377e8;
  --danger: #ff8b7c;
  --success: #68d391;
  --text: #f8fafc;
  --soft: #d7e1ec;
  --muted: #9eacbd;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 10%, rgba(25, 183, 198, 0.17), transparent 30%),
    radial-gradient(circle at 84% 24%, rgba(214, 155, 58, 0.14), transparent 28%),
    linear-gradient(135deg, var(--bg), var(--bg-2) 55%, #07111d);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color-scheme: dark;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

a {
  color: var(--primary);
}

button,
input,
select,
textarea {
  font: inherit;
}

.notice-bar {
  padding: 10px 20px;
  color: var(--soft);
  background: rgba(4, 7, 19, 0.94);
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  text-align: center;
}

.notice-bar strong,
.eyebrow {
  color: var(--accent);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(4, 7, 19, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(25, 183, 198, 0.24);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong,
h1,
h2,
h3 {
  font-family: Outfit, Inter, sans-serif;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

nav a,
button,
.button-link,
.file-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: 0.22s ease;
}

button:hover,
.button-link:hover,
.file-button:hover,
nav a:hover {
  border-color: var(--line-strong);
  color: var(--primary);
  transform: translateY(-1px);
}

.button-link[aria-disabled="true"] {
  opacity: 0.52;
  pointer-events: none;
}

main {
  padding: 30px clamp(16px, 4vw, 48px) 42px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  max-width: 1380px;
  margin: 0 auto 26px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  max-width: 920px;
  font-size: clamp(2.15rem, 4.5vw, 4.5rem);
}

h2 {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
}

h3 {
  font-size: 1.08rem;
}

.lead {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.06rem;
}

.muted {
  color: var(--muted);
}

.hero-actions,
.form-actions,
.library-actions,
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1380px;
  margin: 0 auto;
}

.main-column {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.library-panel,
.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.status-pill,
.case-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--primary);
  background: rgba(25, 183, 198, 0.12);
  border: 1px solid rgba(25, 183, 198, 0.24);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

label,
.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(4, 7, 19, 0.72);
  color: var(--text);
}

textarea {
  resize: vertical;
}

select option {
  color: var(--text);
  background: #0d1826;
}

input::placeholder,
textarea::placeholder {
  color: rgba(158, 172, 189, 0.76);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(25, 183, 198, 0.23);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two,
.ohif-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ohif-fields {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.ohif-fields label:nth-child(1),
.ohif-fields label:nth-child(2) {
  grid-column: 1 / -1;
}

.case-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.case-button {
  width: 100%;
  min-height: auto;
  padding: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
}

.case-button.active {
  border-color: var(--line-strong);
  background: rgba(25, 183, 198, 0.1);
}

.case-button strong {
  display: block;
  margin-bottom: 5px;
}

.case-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.filters {
  margin-top: 12px;
}

.filter.active {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  border-color: transparent;
}

.library-actions {
  margin-top: 16px;
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.privacy-box {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  background: rgba(214, 155, 58, 0.1);
  border: 1px solid rgba(214, 155, 58, 0.25);
  border-radius: 8px;
}

.privacy-box label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--soft);
  font-weight: 500;
}

.privacy-box input {
  width: auto;
  margin-top: 5px;
}

#saveCase {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  border-color: transparent;
  font-weight: 800;
}

#deleteCase {
  color: var(--danger);
}

.viewer-panel {
  min-height: 560px;
}

.viewer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.dropbox-note {
  margin: 0 0 12px;
  padding: 11px 12px;
  color: var(--soft);
  background: rgba(214, 155, 58, 0.1);
  border: 1px solid rgba(214, 155, 58, 0.24);
  border-radius: 8px;
}

.viewer-frame-wrap {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #02040b;
  border: 1px solid var(--line);
  border-radius: 8px;
}

iframe {
  width: 100%;
  height: 520px;
  border: 0;
  background: #02040b;
}

.viewer-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: linear-gradient(135deg, rgba(4, 7, 19, 0.96), rgba(12, 24, 38, 0.96));
}

.viewer-empty h3 {
  color: var(--text);
}

.site-footer {
  display: grid;
  gap: 6px;
  padding: 24px clamp(16px, 4vw, 48px) 34px;
  color: var(--muted);
  background: rgba(4, 7, 19, 0.94);
  border-top: 1px solid var(--line);
}

.site-footer p {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
}

@media print {
  .notice-bar,
  .site-header,
  .library-panel,
  .viewer-panel,
  .hero-actions,
  .form-actions,
  .site-footer {
    display: none !important;
  }

  body {
    color: #111827;
    background: #ffffff;
  }

  main,
  .workspace {
    display: block;
    padding: 0;
  }

  .panel {
    border: 0;
    box-shadow: none;
    background: #ffffff;
  }
}

@media (max-width: 1100px) {
  .workspace,
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .form-grid.two,
  .ohif-fields {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.25rem;
  }
}
