/* Edu Vacancy Platform — design tokens */
:root {
  --color-bg: #f4f6f9;
  --color-surface: #ffffff;
  --color-text: #1a2332;
  --color-text-muted: #5c6b7f;
  --color-primary: #0d4f6c;
  --color-primary-hover: #0a3d54;
  --color-accent: #c45c26;
  --color-accent-soft: #fdf4ef;
  --color-border: #e2e8f0;
  --color-success: #1d6f4a;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", "Georgia", serif;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(13, 79, 108, 0.08);
  --shadow-sm: 0 1px 3px rgba(26, 35, 50, 0.06);
  --max-width: 1120px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__inner span {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
@media screen and (max-width: 600px) {
  .site-header__inner span{
    display: none;
  }
}
.site-header__inner span:hover {
  text-decoration: none;
  color: var(--color-primary-hover);
}
.site-header__inner span:active {
  text-decoration: none;
  color: var(--color-primary-hover);
}
.site-header__inner span:visited {
  text-decoration: none;
  color: var(--color-primary);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
}
.logo:hover {
  text-decoration: none;
  color: var(--color-primary);
}

.logo__mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary), #1a7a9e);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-sans);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
}
.nav a:hover {
  background: var(--color-bg);
  text-decoration: none;
}
.nav a.is-active {
  color: var(--color-primary);
  background: rgba(13, 79, 108, 0.08);
}

.nav__logout {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.nav__logout-btn {
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}
.nav__logout-btn svg {
  vertical-align: middle;
}

.nav__logout-btn:hover {
  background: var(--color-bg);
}

.site-messages {
  padding: 0.75rem 1.25rem 0;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-messages__item {
  margin: 0 0 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.site-messages__item--success {
  background: rgba(29, 111, 74, 0.12);
  color: var(--color-success);
}

.site-messages__item--warning {
  background: rgba(196, 92, 38, 0.12);
  color: var(--color-accent);
}

.site-messages__item--error,
.site-messages__item--danger {
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
}

.site-messages__item--info,
.site-messages__item--debug {
  background: rgba(13, 79, 108, 0.1);
  color: var(--color-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--color-primary-hover);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn--outline:hover {
  background: rgba(13, 79, 108, 0.06);
}

.btn--accent {
  background: var(--color-accent);
  color: #fff;
}
.btn--accent:hover {
  filter: brightness(1.05);
}

.btn--block {
  width: 100%;
}

/* Main */
main {
  flex: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Hero */
.hero {
  background: linear-gradient(160deg, #0d4f6c 0%, #134a5e 45%, #1a5f7a 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(22rem, 52vh, 36rem);
  padding: 2.5rem 0;
}

.hero::after {
  content: "";
  position: absolute;
  right: -10%;
  top: 50%;
  transform: translateY(-50%);
  width: 45%;
  height: 85%;
  max-height: 28rem;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  justify-items: stretch;
  gap: 2rem 2.75rem;
}

.hero__content {
  justify-self: start;
  max-width: 36rem;
}

.hero_image {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 4 / 3;
  max-height: min(22rem, 42vh);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  align-self: center;
  justify-self: center;
}

.hero_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 800px) {
  .hero {
    min-height: 0;
    padding: 2.25rem 0 2.75rem;
  }
  .nav{
    font-size: 13px;
  }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    align-items: center;
    text-align: center;
  }

  .hero__content {
    justify-self: center;
    max-width: 40rem;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero_image {
    order: -1;
    max-height: min(14rem, 38vh);
    max-width: 22rem;
    margin: 0 auto;
  }
}

.hero__eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.9;
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.hero__lead {
  font-size: 1.1rem;
  opacity: 0.92;
  max-width: 42ch;
  margin: 0 0 1.75rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero .btn--primary {
  background: #fff;
  color: var(--color-primary);
}
.hero .btn--primary:hover {
  background: #f0f4f7;
}

.hero .btn--outline {
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
}
.hero .btn--outline:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section--alt {
  background: var(--color-surface);
}

.section__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.section__intro {
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  max-width: 80ch;
}

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(13, 79, 108, 0.1);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
}

.feature-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

/* Vacancies toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 180px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
}

.field input[type="file"] {
  padding: 0.45rem 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.field--grow {
  flex: 1;
  min-width: 200px;
}

/* Vacancy cards */
.vacancy-grid {
  display: grid;
  gap: 1rem;
}

.vacancy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  align-items: start;
}

@media (max-width: 640px) {
  .vacancy-card {
    grid-template-columns: 1fr;
  }
}

.vacancy-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.badge--he {
  background: #e8f2f6;
  color: var(--color-primary);
}

.badge--prof {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.badge--applied {
  background: rgba(13, 79, 108, 0.12);
  color: var(--color-primary);
  align-self: center;
}

.badge--status-submitted {
  background: #e8f2f6;
  color: var(--color-primary);
}

.badge--status-review {
  background: #eef2ff;
  color: #3730a3;
}

.badge--status-shortlisted {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.badge--status-accepted {
  background: rgba(29, 111, 74, 0.15);
  color: var(--color-success);
}

.badge--status-rejected {
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
}

.applications-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.applications-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.applications-table th,
.applications-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.applications-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-bg);
}

.applications-table tr:last-child td {
  border-bottom: none;
}

.applications-table__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.vacancy-card h2 {
  font-size: 1.2rem;
  margin: 0.25rem 0 0;
  grid-column: 1 / -1;
}

.vacancy-card__institution {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  grid-column: 1 / -1;
}

.vacancy-card__details {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.vacancy-card__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px dashed var(--color-border);
}

/* Application form */
.form-page {
  padding: 2rem 0 3.5rem;
}

.form-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 320px;
  align-items: start;
}

@media (max-width: 600px) {
  .form-layout {
    grid-template-columns: 100%;
  }
}

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 1rem;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.field--full {
  grid-column: 1 / -1;
  margin-bottom: 1rem;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input.error,
.field select.error,
.field textarea.error {
  border-color: #b91c1c;
}

.field-error {
  font-size: 0.8rem;
  color: #b91c1c;
  margin-top: -0.2rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.sidebar-card h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}

.sidebar-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.sidebar-card .vacancy-summary {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.sidebar-card strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

/* Success */
.success-panel {
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 520px;
  margin: 0 auto;
}

.success-panel__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: rgba(29, 111, 74, 0.12);
  color: var(--color-success);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.success-panel h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
}

.success-panel p {
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
}

/* Footer */
.site-footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.85);
  padding: 2rem 0;
  margin-top: auto;
  font-size: 0.9rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: #fff;
}

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

/* Django form errors */
ul.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #b91c1c;
}

ul.errorlist.nonfield {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(185, 28, 28, 0.06);
  border-radius: 8px;
}

.field ul.errorlist {
  margin-top: 0.35rem;
}
