:root {
  --bg-color: #ffffff;
  --plus-color: #c7d7ec;
  --title-color: #9db8e5;
  --input-bg: rgba(248, 252, 255, 0.98);
  --sheet-bg: rgba(248, 252, 255, 0.95);
  --form-bg: rgba(248, 252, 255, 0.55);
  --input-shadow: 0 12px 35px rgba(33, 58, 95, 0.15);
  --card-shadow: 0 35px 90px rgba(20, 30, 60, 0.12);
  --radius-card: 32px;
  --radius-pill: 999px;
  --text-color: #1f2a37;
  --accent-blue: #3e6cb3;
  --accent-blue-dark: #1d3a71;
  --tag-text: #0e1b2e;
  --error-color: #b9384f;
  --success-color: #1f8c4c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Roboto', sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--plus-color);
  opacity: 0.45;
  mask-image: url("data:image/svg+xml,%3Csvg width='50' height='50' viewBox='0 0 50 50' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='24' y='20' width='2' height='10' rx='1'/%3E%3Crect x='20' y='24' width='10' height='2' rx='1'/%3E%3C/svg%3E");
  mask-size: 50px 50px;
  mask-repeat: repeat;
  transform: translate(var(--bg-shift-x, 0px), var(--bg-shift-y, 0px));
  transition: transform 0.6s ease;
}

main {
  position: relative;
  z-index: 1;
  padding: 40px 0 40px;
  display: flex;
  justify-content: center;
}

form#advisor-form {
  position: relative;
  width: 70vw;
  background: var(--form-bg);
  border-radius: var(--radius-card);
  padding: 36px 56px 36px;
  box-shadow: var(--card-shadow);
}

h1 {
  margin: 0 auto 24px;
  text-align: center;
  letter-spacing: 0.6em;
  font-weight: 400;
  color: var(--title-color);
  text-transform: none;
  font-size: 1.2rem;
}

.top-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  gap: 10px;
}

.field input {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--input-bg);
  padding: 18px 26px;
  font-size: 0.8rem;
  box-shadow: var(--input-shadow);
  color: var(--text-color);
}

.field input:focus {
  outline: 2px solid rgba(62, 108, 179, 0.25);
}

/* Splash Screen */
.splash {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash--hidden {
  opacity: 0;
  visibility: hidden;
}

.splash__panel {
  background: rgba(255, 253, 248, 0.95);
  width: min(420px, 90vw);
  padding: 48px 40px 56px;
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.splash__prompt {
  margin: 0;
  font-weight: 700;
  text-transform: lowercase;
}

.splash__input {
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  padding: 18px 26px;
  font-size: 1.1rem;
  text-align: center;
  box-shadow: var(--input-shadow);
  background: rgba(255, 255, 255, 0.85);
}

.splash__input:focus {
  outline: 2px solid rgba(62, 108, 179, 0.35);
}

.splash__button {
  border: none;
  padding: 14px 36px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.2em;
  background: transparent;
  color: var(--title-color);
  cursor: pointer;
}

.splash__status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--error-color);
}

/* Layout */
.choices {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.choices__table {
  flex: 1;
}

.table-wrapper {
  overflow-x: auto;
  background: var(--sheet-bg);
  border-radius: 28px;
  box-shadow: var(--card-shadow);
  padding: 4px;
  position: relative;
}

/* Table + Sortable */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.8rem;
}

.rank-heading,
.rank-cell {
  width: 100px;
  text-align: center;
  font-weight: 600;
  color: var(--title-color);
}

th {
  font-weight: 700;
  border-bottom: 2px solid rgba(90, 111, 148, 0.25);
}

tbody tr {
  border-bottom: 1px solid rgba(90, 111, 148, 0.18);
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(236, 244, 255, 0.6);
}

tbody tr.dragging {
  background: rgba(62, 108, 179, 0.1);
}

.advisor-row.reordered {
  animation: reorderPulse 0.6s ease;
}

@keyframes reorderPulse {
  0% {
    background: rgba(62, 108, 179, 0.25);
  }
  100% {
    background: transparent;
  }
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  margin: 2px 6px 2px 0;
  color: #000;
}

.table-guidance {
  margin: 20px auto 20px;
  width: 70vw;
  font-size: 0.95rem;
  color: var(--title-color);
  text-align: center;
}

.drag-tooltip {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 0.85rem;
  color: var(--title-color);
  box-shadow: 0 18px 35px rgba(20, 30, 60, 0.18);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
}

.drag-tooltip--visible {
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* Buttons */
.primary-btn {
  border: none;
  border-radius: var(--radius-pill);
  padding: 18px 38px;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: linear-gradient(120deg, var(--accent-blue), var(--accent-blue-dark));
  color: #fff;
  box-shadow: 0 20px 40px rgba(33, 58, 95, 0.25);
  cursor: pointer;
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-footer {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.form-status {
  min-height: 1.2em;
  font-size: 0.95rem;
  text-align: center;
}

.form-status--success {
  color: var(--success-color);
}

.form-status--error {
  color: var(--error-color);
}

/* Misc */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  form#advisor-form {
    width: min(96vw, 640px);
    padding: 36px 32px 48px;
  }

  .choices {
    flex-direction: column;
  }

  .choices__table {
    width: 100%;
  }

  .table-guidance {
    width: min(96vw, 640px);
  }
}
