/* Robot page layout overrides.
   Shared theme tokens and component colors come from app.css. */

:root {
  --row-gap: 70px;
  --block-gap: 60px;
}

body {
  font-size: var(--text-lg);
  line-height: 1.7;
  background-attachment: scroll;
}

html.dark {
  --background-gradient:
    radial-gradient(1000px circle at 12% -18%, rgba(129, 145, 162, 0.12) 0%, rgba(129, 145, 162, 0) 56%),
    radial-gradient(760px circle at 90% 0%, rgba(63, 79, 95, 0.1) 0%, rgba(63, 79, 95, 0) 62%),
    linear-gradient(160deg, #0E1319 0%, #111923 100%);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 32px 0 20px;
  width: 100%;
  position: relative;
}

.hero__header {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  padding: 0;
  max-width: var(--container-w);
  margin: 0 auto;
}

.hero__logo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 16px;
  padding: 0 60px;
}

.hero__logo-group {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
}

.hero__logo {
  width: 270px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: none;
}

.hero__subtitle {
  margin: 0;
  color: var(--muted-foreground);
}

html.dark .hero__logo {
  filter: invert(1) brightness(1.04);
}

.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--row-gap);
  margin-bottom: calc(var(--block-gap) * 2.5);
}

.row.rank-row {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  column-gap: 20px !important;
  row-gap: 12px !important;
}

.row.rank-row > [class^="col-"] {
  grid-column: span 1 !important;
}

.rank-row__note {
  grid-column: 1 / -1;
}

.rank-row__summary {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
}

.row:has(#rank_say),
.row.has-rank-say {
  padding-top: var(--block-gap);
  margin-top: 0;
}

#burs-orani-row {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--block-gap) + 50px);
  margin-top: 0;
}

#burs-orani-row > .col-4 {
  grid-column: span 4;
}

@media (min-width: 901px) {
  #burs-orani-row .uni-type-col,
  #burs-orani-row #scholarship-col,
  #burs-orani-row .language-col {
    grid-column: span 4;
  }
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0;
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 16px;
  color: var(--foreground);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 16px;
}

.filter-fieldset__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.filter-fieldset__content .ms {
  flex: 1 1 auto;
}

.ms {
  position: relative;
  padding-top: 2px;
  margin-bottom: var(--block-gap);
}

#ms-majors {
  margin-bottom: calc(var(--block-gap) + 8px);
}

.ms .summary {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin: 0 0 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

.ms .input-shell {
  position: relative;
  width: 100%;
}

input[type="number"],
input[type="search"],
input.rank-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--glass-border-strong) !important;
  background: var(--glass-bg-soft);
  color: var(--foreground);
  border-radius: 8px;
  padding: 0 8px;
  box-sizing: border-box;
  box-shadow: var(--glass-inner-highlight);
  font-size: 18px;
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.ms input[type="search"] {
  padding: 0 40px 0 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="number"]:focus,
input[type="search"]:focus,
input.rank-input:focus,
.ms input[type="search"]:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ring) 42%, transparent);
}

#ms-majors .input-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

#ms-majors .input-shell {
  flex: 1 1 0;
  min-width: 0;
}

.legend-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 8px;
  min-height: 44px;
  margin-left: 16px;
  color: var(--foreground);
  flex: 0 0 auto;
  transform: translateY(0.5px);
}

.legend-toggle input[type="checkbox"] {
  margin: 0 10px 0 0;
}

.legend-toggle__label {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 44px;
  line-height: 1.15;
  text-align: left;
  font-size: 12px;
  letter-spacing: -0.01em;
  margin: 0;
}

.legend-toggle__label span {
  display: block;
}

.filter-fieldset--with-toggle #ms-majors .input-wrap {
  position: static;
  overflow: visible;
}

.filter-fieldset--with-toggle #ms-majors .input-wrap > .legend-toggle {
  position: static;
  transform: none;
  margin-left: 16px;
  min-height: 44px;
  z-index: 1;
}

.filter-fieldset--with-toggle #ms-majors .dropdown {
  right: 180px;
}

.filter-fieldset--with-toggle #ms-majors .chevron {
  right: 12px;
}

#burs-orani-row .ms .summary {
  line-height: 1.35;
  min-height: 2.7em;
}

.form-action {
  display: grid;
  gap: 8px;
  width: 100%;
}

.form-action__hint {
  margin: 0;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-align: center;
}

.button-actions {
  align-items: stretch;
  gap: 14px;
}

.secondary.outline {
  margin-top: clamp(267px, 12vw, 176px);
}

@media (max-width: 900px) {
  .col-6,
  .col-4,
  .col-3,
  #burs-orani-row > .col-4 {
    grid-column: span 12;
  }
}

@media (max-width: 800px) {
  .filter-fieldset__content {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  #ms-majors .input-wrap {
    align-items: flex-start;
    gap: 8px;
  }

  .legend-toggle,
  .filter-fieldset--with-toggle #ms-majors .input-wrap > .legend-toggle {
    align-self: flex-start;
    margin-left: 0;
    margin-top: 8px;
    min-height: auto;
    transform: none;
  }

  .filter-fieldset--with-toggle #ms-majors .dropdown {
    right: 0;
  }
}

@media (max-height: 1199px) {
  :root {
    --block-gap: 44px;
    --row-gap: 34px;
  }

  .hero {
    margin: 16px 0 12px;
  }

  .hero__logo {
    width: min(270px, 72vw);
    height: auto;
  }

  .row {
    margin-bottom: calc(var(--block-gap) * 1.5);
  }

  fieldset {
    padding: 12px 16px;
  }

  legend,
  label {
    margin-bottom: 4px;
    font-size: 14px;
  }

  input[type="number"],
  input[type="search"],
  input.rank-input,
  select {
    height: 38px;
    font-size: 16px;
  }

  .ms,
  #ms-majors {
    margin-bottom: var(--block-gap);
  }

  #submitBtn,
  #showAllBtn {
    height: 40px;
    font-size: 1.1rem;
  }
}
