:root {
  --ink: #141d24;
  --muted: #66737e;
  --line: #d8e0e6;
  --paper: #f5f6f2;
  --panel: rgba(255, 255, 255, 0.92);
  --blue: #1559c7;
  --shadow: 0 24px 70px rgba(20, 29, 36, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(125deg, rgba(21, 89, 199, 0.12), transparent 34%),
    linear-gradient(300deg, rgba(20, 29, 36, 0.08), transparent 44%),
    var(--paper);
  font-family: Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
}

button {
  cursor: pointer;
  font: inherit;
}

.flag-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.flag-frame::before,
.flag-frame::after {
  content: "🇵🇹 🇪🇸 🇫🇷 🇧🇪 🇳🇱 🇱🇺 🇩🇪 🇦🇹 🇮🇹";
  position: fixed;
  left: 0;
  right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: pre;
  background: rgba(255, 255, 255, 0.76);
  border-block: 1px solid rgba(216, 224, 230, 0.9);
  font-size: 1.28rem;
  letter-spacing: 12px;
  text-indent: 18px;
}

.flag-frame::before {
  top: 0;
}

.flag-frame::after {
  bottom: 0;
}

.swipe-app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 20px;
  min-height: 100vh;
  padding: 58px 20px;
}

.hero-bar,
.deck-panel {
  width: min(640px, 100%);
  margin-inline: auto;
}

.hero-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.25rem, 7vw, 4.8rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.7rem;
}

.language-toggle {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(20, 29, 36, 0.12);
  font-weight: 800;
}

.home-button {
  position: fixed;
  top: 46px;
  left: 18px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(20, 29, 36, 0.16);
  font-size: 1.35rem;
  font-weight: 900;
}

.deck-panel {
  display: grid;
  grid-template-rows: auto minmax(510px, 1fr) auto;
  gap: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid rgba(216, 224, 230, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.deck-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.deck-count {
  padding: 8px 12px;
  color: var(--muted);
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 850;
}

.swipe-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 510px;
  perspective: 1100px;
}

.swipe-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(350px, 1fr) auto;
  width: min(520px, 100%);
  min-height: 560px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(216, 224, 230, 0.95);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(20, 29, 36, 0.28);
  touch-action: none;
  transform: translateX(var(--drag-x, 0px)) rotate(var(--drag-rotate, 0deg));
  transition: transform 180ms ease, opacity 180ms ease;
}

.swipe-card.swipe-left {
  transform: translateX(-780px) rotate(-18deg);
  opacity: 0;
}

.swipe-card.swipe-right {
  transform: translateX(780px) rotate(18deg);
  opacity: 0;
}

.card-image {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(20, 29, 36, 0.02), rgba(20, 29, 36, 0.74)),
    var(--photo),
    var(--fallback);
  background-position: center;
  background-size: cover;
}

.card-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--flag);
  opacity: 0.16;
  mix-blend-mode: multiply;
}

.card-flag {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 94px;
  height: 60px;
  overflow: hidden;
  background: var(--flag);
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  box-shadow: 0 10px 22px rgba(20, 29, 36, 0.25);
}

.card-flag span {
  position: absolute;
  left: -8px;
  bottom: -12px;
  font-size: 2rem;
}

.choice-chip {
  position: absolute;
  left: 16px;
  top: 16px;
  padding: 9px 12px;
  color: #fff;
  background: rgba(20, 29, 36, 0.72);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 850;
}

.photo-caption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  color: #fff;
}

.photo-caption p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 7px 10px;
  color: var(--muted);
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pill:hover,
.pill:focus-visible,
.pill.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.interest-block {
  display: grid;
  gap: 8px;
  text-align: center;
}

.interest-block p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.round-action {
  display: grid;
  place-items: center;
  min-width: 96px;
  height: 54px;
  padding: 0 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(20, 29, 36, 0.16);
  font-size: 0.95rem;
  font-weight: 850;
}

.round-action.info {
  min-width: 82px;
  height: 48px;
}

.hidden {
  display: none !important;
}

.education-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 58px 20px;
}

.education-shell {
  width: min(980px, 100%);
  margin-inline: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid rgba(216, 224, 230, 0.92);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.compact-shell {
  width: min(720px, 100%);
}

.education-intro {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.university-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.university-card,
.conditions-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.university-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.university-card h3 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.university-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.university-card a {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.conditions-panel {
  padding: 18px;
}

.conditions-panel ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-inline-start: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.choice-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  text-align: start;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(20, 29, 36, 0.08);
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.choice-card strong {
  font-size: 1.2rem;
}

.choice-card span,
.verify-row,
.register-form span {
  color: var(--muted);
  line-height: 1.45;
}

.verify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 750;
}

.verify-row input {
  width: 18px;
  height: 18px;
}

.register-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.register-form label {
  display: grid;
  gap: 7px;
}

.register-form input,
.register-form select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.submit-button {
  min-height: 48px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.jobs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.jobs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.jobs-meta span {
  padding: 7px 10px;
  color: var(--muted);
  background: #eef3f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.job-list {
  display: grid;
  gap: 12px;
}

.admin-login,
.admin-job-form {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-login label,
.admin-form-grid {
  display: grid;
  gap: 7px;
}

.admin-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.admin-login p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 800;
}

.admin-job-form label {
  display: grid;
  gap: 7px;
}

.admin-login span,
.admin-job-form span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-login input,
.admin-job-form input,
.admin-job-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.job-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.job-art {
  min-height: 118px;
  overflow: hidden;
  background: #eef3f6;
  border-radius: 6px;
}

.job-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.job-body {
  display: grid;
  gap: 8px;
}

.job-body h3,
.job-body p {
  margin-bottom: 0;
}

.job-body p {
  color: var(--muted);
  line-height: 1.45;
}

.job-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-footer span {
  padding: 6px 9px;
  color: var(--muted);
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 750;
}

[dir="ltr"] body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[dir="ltr"] .card-flag {
  left: 16px;
  right: auto;
}

[dir="ltr"] .card-flag span {
  right: -8px;
  left: auto;
}

[dir="ltr"] .choice-chip {
  right: 16px;
  left: auto;
}

@media (max-width: 620px) {
  .swipe-app {
    padding: 50px 12px;
  }

  .hero-bar {
    align-items: center;
  }

  h1 {
    font-size: 2.55rem;
  }

  .deck-panel {
    grid-template-rows: auto minmax(450px, 1fr) auto;
    padding: 12px;
  }

  .swipe-stage {
    min-height: 450px;
  }

  .swipe-card {
    min-height: 500px;
  }

  .card-image {
    min-height: 310px;
  }

  .round-action {
    min-width: 82px;
    padding: 0 12px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .job-card {
    grid-template-columns: 1fr;
  }
}
