:root {
  --signup-bg: #ffffff;
  --signup-text: #000000;
  --signup-heading: #000000;
  --signup-accent: #18b9fa;
  --signup-card-bg: #ffffff;
  --signup-card-text: #000000;
  --signup-card-border: #7a7a7a;
  --signup-card-shadow: 0 4px 30px 4px rgba(0, 0, 0, 0.25);
  --signup-link: #0a6ce1;
  --signup-terms-link: #0a6ce1;
  --signup-button-bg: #18b9fa;
  --signup-button-text: #fefefe;
  --signup-muted: #7e7e7e;
  --signup-checkbox-border: rgba(0, 0, 0, 0.39);
  --signup-error: #c62828;
  --signup-success: #1b5e20;
  --signup-shape-corner-size: clamp(260px, 21.88vw, 420px);
  --signup-shape-block-width: clamp(220px, 18.75vw, 360px);
  --signup-shape-block-height: clamp(260px, 19.79vw, 380px);
  --signup-ellipse-width: clamp(468px, 40.3vw, 774px);
  --signup-ellipse-height: clamp(486px, 45vw, 864px);
  --signup-mask-blob-size: clamp(468px, 40.3vw, 774px);
  --signup-mask-character-width: clamp(378px, 30vw, 576px);
  --signup-logo-size: clamp(72px, 6.25vw, 120px);
  --signup-logo-offset: clamp(16px, 4vw, 56px);
  --signup-ellipse-lock-x: 0px;
  --signup-ellipse-lock-y: 0px;
  --signup-blob-lock-x: 0px;
  --signup-blob-lock-y: 0px;
  --signup-character-lock-x: 0px;
  --signup-character-lock-y: 0px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Archivo", sans-serif;
  background: var(--signup-bg);
  color: var(--signup-text);
}

.signup-page {
  min-height: 100vh;
  overflow-x: hidden;
}

body[data-theme="dark"] {
  --signup-bg: #003246;
  --signup-text: #ffffff;
  --signup-heading: #ffffff;
  --signup-card-bg: #05668d;
  --signup-card-text: #ffffff;
  --signup-card-border: #17b8f9;
  --signup-link: #18b9fa;
  --signup-terms-link: #d5f873;
  --signup-button-bg: #17b8f9;
  --signup-button-text: #000000;
  --signup-muted: #ffffff;
  --signup-error: #ffb4b4;
  --signup-success: #b9f6ca;
}

.signup-card__fields img {
  filter: brightness(0);
}

body[data-theme="dark"] .signup-card__fields img {
  filter: brightness(0) invert(1);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input {
  font: inherit;
  color: inherit;
}

.signup {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.signup__frame {
  position: relative;
  width: 100%;
  max-width: 1440px;
  min-height: 100vh;
  background: var(--signup-bg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr clamp(289px, 32.3vw, 443px);
  grid-template-rows: auto auto;
  align-items: center;
  align-content: center;
  padding: clamp(24px, 4vh, 80px) clamp(24px, 4vw, 80px);
  column-gap: clamp(16px, 2vw, 40px);
  row-gap: clamp(14px, 2vh, 28px);
}

.auth-theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(5, 102, 141, 0.25);
  background: rgba(255, 255, 255, 0.92);
  color: var(--signup-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body[data-theme="dark"] .auth-theme-toggle {
  border-color: rgba(23, 184, 249, 0.35);
  background: rgba(5, 102, 141, 0.9);
}

.auth-theme-toggle svg {
  width: 20px;
  height: 20px;
}

.auth-theme-toggle .icon-sun {
  display: none;
}

body[data-theme="dark"] .auth-theme-toggle .icon-sun {
  display: block;
}

body[data-theme="dark"] .auth-theme-toggle .icon-moon {
  display: none;
}

.signup__shape--corner {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--signup-shape-corner-size);
  height: var(--signup-shape-corner-size);
  transform: translate(-30%, -30%);
  pointer-events: none;
  z-index: 0;
}

.signup__shape--block {
  position: fixed;
  left: 0;
  bottom: 0;
  width: var(--signup-shape-block-width);
  height: var(--signup-shape-block-height);
  border-radius: 0 30px 0 0;
  background: var(--signup-accent);
  pointer-events: none;
  transform: translate(-32%, 28%);
  opacity: 0.9;
  z-index: 0;
}


.signup__visual {
  position: absolute;
  top: 50%;
  left: 47%;
  width: var(--signup-ellipse-width);
  height: var(--signup-ellipse-height);
  transform: translate(var(--signup-ellipse-lock-x), var(--signup-ellipse-lock-y))
    translate(-50%, -48%);
  pointer-events: none;
  z-index: 0;
}

.signup__visual > * {
  position: absolute;
}

.signup__ellipse {
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.signup__ellipse img {
  width: min(561.87px, 68%);
  max-width: 100%;
  height: auto;
  transform: rotate(2deg) scale(1.15);
  transform-origin: center;
}

.signup__mask {
  pointer-events: none;
  height: auto;
}

.signup__mask--blob {
  top: 52%;
  left: 40%;
  /* width: var(--signup-mask-blob-size); */
  max-width: 88%;
  transform: translate(-30%, -56%) scale(1.5);
  transform-origin: center;
  z-index: 1;
}

.signup__mask--character {
  right: -6%;
  bottom: -8%;
  width: var(--signup-mask-character-width);
  aspect-ratio: 519.5 / 741.5;
  transform: translate(-28%, -15%);
  z-index: 2;
}

.signup__mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.signup__headline {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  width: 100%;
  max-width: 710px;
  padding-right: clamp(0px, calc((100vw - 1536px) * 0.35), 100px);
  z-index: 2;
}

.signup__title {
  font-size: clamp(36px, 3.6vw, 69px);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
  color: var(--signup-heading);
}

.signup__title-accent {
  display: block;
  color: var(--signup-accent);
}

.signup__title-main {
  display: block;
  color: var(--signup-heading);
}

.signup__subtitle {
  margin: 12px 0 0;
  font-size: clamp(25px, 2.52vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--signup-heading);
}

.signup__subtitle-accent {
  color: var(--signup-accent);
}

.signup-card {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: 100%;
  padding: clamp(8px, 1vw, 12px);
  border-radius: 13px;
  background: var(--signup-card-bg);
  box-shadow: var(--signup-card-shadow);
  color: var(--signup-card-text);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 14px);
  z-index: 3;
}

.signup-card__title {
  margin: 0;
  text-align: center;
  font-size: clamp(20px, 2.04vw, 31.6px);
  font-weight: 600;
}

.signup-card__fields {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 0.85vw, 14px);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.43vw, 10px);
}

.form-field__label {
  font-size: clamp(11px, 0.94vw, 14px);
  font-weight: 600;
}

.form-field__input {
  position: relative;
}

.form-field__input input {
  width: 100%;
  height: clamp(28px, 2.2vw, 34px);
  border-radius: 12px;
  border: 1px solid rgba(5, 102, 141, 0.18);
  padding: 0 10px 0 34px;
  background: #f4fbff;
  color: #024560;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(4, 56, 78, 0.1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body[data-theme="dark"] .form-field__input input {
  background: rgba(23, 184, 249, 0.1);
  color: #ffffff;
  border: 1px solid rgba(23, 184, 249, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.form-field__input input:focus {
  outline: none;
  border-color: rgba(24, 185, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(24, 185, 250, 0.2);
}

.form-field__input input:-webkit-autofill,
.form-field__input input:-webkit-autofill:hover,
.form-field__input input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f4fbff inset !important;
  -webkit-text-fill-color: #024560 !important;
  caret-color: #024560;
}

body[data-theme="dark"] .form-field__input input:-webkit-autofill,
body[data-theme="dark"] .form-field__input input:-webkit-autofill:hover,
body[data-theme="dark"] .form-field__input input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #05668d inset !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #ffffff;
}

.form-field__icon {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--signup-card-text);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s;
}

.password-toggle:hover {
  opacity: 1;
}

.password-toggle .eye-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.form-field__input input {
  padding-right: 34px;
}

.form-field__input--phone input {
  background: #f4fbff;
  color: #024560;
}

body[data-theme="dark"] .form-field__input--phone input {
  background: rgba(23, 184, 249, 0.1);
  color: #ffffff;
}

.form-field__icon--username {
  width: 24px;
  height: 24px;
}

.form-field__icon--email {
  width: 24px;
  height: 20px;
}

.form-field__icon--phone {
  width: 32px;
  height: 34px;
  opacity: 0.8;
  transform: translate(-23%, -50%);
}

.form-field__icon--university {
  width: 24px;
  height: 24px;
  filter: none;
}

body[data-theme="dark"] .form-field__icon--university {
  filter: invert(1) brightness(1.5);
}

.form-field__icon--faculty {
  width: 24px;
  height: 24px;
}

.form-field__icon--password,
.form-field__icon--confirm-password {
  width: 20px;
  height: 24px;
}

body[data-theme="dark"] .form-field__icon--username {
  filter: invert(1) brightness(1.2);
}

.form-field__icon--username {
  transition: filter 0.2s ease-in-out;
}

body[data-theme="dark"] .form-field__icon--username {
  filter: invert(1) saturate(0) brightness(2);
}

.form-field__input--phone input {
  padding-left: 42px;
}

.form-field__prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translate(-25%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: #024560;
  z-index: 1;
}

body[data-theme="dark"] .form-field__prefix {
  color: rgba(255, 255, 255, 0.75);
}

.form-field__divider {
  position: absolute;
  left: 33px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: clamp(18px, 1.5vw, 22px);
  background: rgba(5, 102, 141, 0.25);
}

body[data-theme="dark"] .form-field__divider {
  background: rgba(23, 184, 249, 0.35);
}

.form-field__input--select {
  position: relative;
}

.form-field__input--select select {
  width: 100%;
  height: clamp(28px, 2.2vw, 34px);
  border-radius: 12px;
  border: 1px solid rgba(5, 102, 141, 0.18);
  padding: 0 34px 0 34px;
  background: #f4fbff;
  color: #024560;
  font-size: 12px;
  font-weight: 600;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23024560" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  box-shadow: 0 4px 14px rgba(4, 56, 78, 0.1);
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body[data-theme="dark"] .form-field__input--select select {
  background: rgba(23, 184, 249, 0.1);
  color: #ffffff;
  border: 1px solid rgba(23, 184, 249, 0.3);
  background-image: url('data:image/svg+xml;utf8,<svg fill="%2317b8f9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.form-field__input--select select:focus {
  outline: none;
  border-color: rgba(24, 185, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(24, 185, 250, 0.2);
}

.form-field__input--select select option {
  background: #f4fbff;
  color: #024560;
  font-weight: 600;
  padding: 8px 12px;
}

.form-field__input--select select option[value=""] {
  color: rgba(2, 69, 96, 0.45);
  font-weight: 400;
}

body[data-theme="dark"] .form-field__input--select select option {
  background: #05668d;
  color: #ffffff;
}

body[data-theme="dark"] .form-field__input--select select option[value=""] {
  color: rgba(255, 255, 255, 0.4);
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.form-checkbox input {
  appearance: none;
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.form-checkbox__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid rgba(5, 102, 141, 0.3);
  background: #f4fbff;
  box-shadow: 0 2px 8px rgba(4, 56, 78, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-checkbox__check {
  width: 10px;
  height: 9px;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.form-checkbox input:checked ~ .form-checkbox__box {
  background: #18b9fa;
  border-color: #18b9fa;
  box-shadow: 0 4px 12px rgba(24, 185, 250, 0.35);
}

.form-checkbox input:checked ~ .form-checkbox__box .form-checkbox__check {
  opacity: 1;
  transform: scale(1);
}

.form-checkbox:hover .form-checkbox__box {
  border-color: #18b9fa;
  box-shadow: 0 0 0 3px rgba(24, 185, 250, 0.15);
}

.form-checkbox input:focus-visible ~ .form-checkbox__box {
  outline: 2px solid #18b9fa;
  outline-offset: 2px;
}

.form-checkbox__label {
  font-size: 12px;
  font-weight: 600;
  color: #024560;
}

.form-checkbox__label a {
  color: #18b9fa;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.form-checkbox__label a:hover {
  color: #0a6ce1;
}

body[data-theme="dark"] .form-checkbox__box {
  background: rgba(23, 184, 249, 0.1);
  border-color: rgba(23, 184, 249, 0.3);
}

body[data-theme="dark"] .form-checkbox input:checked ~ .form-checkbox__box {
  background: #17b8f9;
  border-color: #17b8f9;
}

body[data-theme="dark"] .form-checkbox__label {
  color: #ffffff;
}

body[data-theme="dark"] .form-checkbox__label a {
  color: #d5f873;
}

.signup-card__submit {
  width: 100%;
  height: clamp(24px, 1.96vw, 28px);
  border: none;
  border-radius: 5px;
  background: var(--signup-button-bg);
  color: var(--signup-button-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.signup__login {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  width: 100%;
  font-size: clamp(14px, 1.2vw, 16.941px);
  color: var(--signup-heading);
  display: flex;
  gap: 6px;
  align-items: baseline;
  justify-content: center;
  z-index: 2;
}

.signup__login a {
  color: var(--signup-link);
  font-weight: 500;
  text-decoration: underline;
}

.signup__logo {
  position: fixed;
  right: var(--signup-logo-offset);
  bottom: var(--signup-logo-offset);
  width: var(--signup-logo-size);
  height: auto;
  z-index: 4;
  display: block;
  transform: translate(25%, 50%);
}

.signup__logo img {
  width: 100%;
  height: auto;
  display: block;
}

.form-message {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.form-message--error {
  color: var(--signup-error);
  border: 1px solid rgba(198, 40, 40, 0.35);
  background: rgba(198, 40, 40, 0.08);
}

.form-message--success {
  color: var(--signup-success);
  border: 1px solid rgba(27, 94, 32, 0.35);
  background: rgba(27, 94, 32, 0.08);
}

.signup__login-link {
  color: var(--signup-link);
  font-weight: 500;
  text-decoration: underline;
}

.is-invalid {
  border-color: #d32f2f !important;
}

@media (max-width: 1200px) {
  .signup__frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    min-height: auto;
    padding: 72px 24px 80px;
    row-gap: 24px;
  }

  .signup__shape--corner,
  .signup__shape--block,
  .signup__visual {
    display: none;
  }

  .signup__headline {
    grid-column: 1;
    grid-row: 1;
    text-align: center;
    max-width: 640px;
  }

  .signup__title {
    font-size: clamp(36px, 6vw, 54px);
  }

  .signup__subtitle {
    font-size: clamp(26px, 4.5vw, 36px);
  }

  .signup-card {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    width: min(520px, 100%);
  }

  .signup__login {
    grid-column: 1;
    grid-row: 3;
    justify-self: center;
  }

  .signup__logo {
    position: fixed;
    right: var(--signup-logo-offset);
    bottom: var(--signup-logo-offset);
  }
}

@media (max-width: 640px) {
  .signup__frame {
    padding: 60px 16px 64px;
  }

  .signup__title {
    font-size: clamp(28px, 7vw, 40px);
  }

  .signup__subtitle {
    font-size: clamp(22px, 5vw, 28px);
  }

  .signup-card {
    padding: 14px;
  }

  .signup-card__fields {
    gap: 10px;
  }
}

/* University Autocomplete Styles */
.university-autocomplete-wrapper {
  position: relative;
}

.university-autocomplete-input {
  width: 100%;
  height: clamp(28px, 2.2vw, 34px);
  border-radius: 12px;
  border: 1px solid rgba(5, 102, 141, 0.18);
  padding: 0 10px 0 34px;
  background: #f4fbff;
  color: #024560;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(4, 56, 78, 0.1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

body[data-theme="dark"] .university-autocomplete-input {
  background: rgba(23, 184, 249, 0.1);
  color: #ffffff;
  border: 1px solid rgba(23, 184, 249, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.university-autocomplete-input:focus {
  outline: none;
  border-color: rgba(24, 185, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(24, 185, 250, 0.2);
}

.university-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: none;
  background: var(--signup-card-bg);
  border: 1px solid rgba(5, 102, 141, 0.18);
  border-top: none;
  border-radius: 0 0 12px 12px;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
}

body[data-theme="dark"] .university-list {
  border-color: rgba(23, 184, 249, 0.3);
}

.university-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid rgba(5, 102, 141, 0.08);
}

.university-item:last-child {
  border-bottom: none;
}

.university-item:hover {
  background-color: rgba(24, 185, 250, 0.08);
}

body[data-theme="dark"] .university-item:hover {
  background-color: rgba(23, 184, 249, 0.15);
}

.university-name {
  flex: 1;
  font-size: 12px;
  color: var(--signup-card-text);
  font-weight: 500;
}

.university-name strong {
  color: #18b9fa;
  font-weight: 700;
}

.university-type {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  white-space: nowrap;
}

.university-type.public {
  background-color: rgba(27, 94, 32, 0.15);
  color: #1b5e20;
}

body[data-theme="dark"] .university-type.public {
  background-color: rgba(185, 246, 202, 0.2);
  color: #b9f6ca;
}

.university-type.private {
  background-color: rgba(24, 185, 250, 0.15);
  color: #18b9fa;
}

body[data-theme="dark"] .university-type.private {
  background-color: rgba(23, 184, 249, 0.2);
  color: #17b8f9;
}

.university-type.national {
  background-color: rgba(255, 152, 0, 0.15);
  color: #ff6f00;
}

body[data-theme="dark"] .university-type.national {
  background-color: rgba(255, 152, 0, 0.2);
  color: #ffb74d;
}

.university-type.technological {
  background-color: rgba(156, 39, 176, 0.15);
  color: #7b1fa2;
}

body[data-theme="dark"] .university-type.technological {
  background-color: rgba(198, 124, 221, 0.2);
  color: #ce93d8;
}

.university-no-results {
  padding: 20px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--signup-muted);
}
