/* Root */
:root {
  --font-family: "Montserrat", sans-serif;

  --color-primary: #dbb751;
  --color-primary-15: #302b1b;
  --color-base: #121212;
  --color-1: #1a1a1a;
  --color-3: #505050;
  --color-5: #afafaf;
  --color-white: #f8f8ff;
  --color-success: #309d1f;
  --color-danger: #f7504f;
  --color-text-on-dark: #f8f8ff;
  --color-text-on-light: #121212;
  --color-placeholder-text: #7e7e7e;
  --color-muted-text: #afafaf;
  --color-error-text: #f7504f;

  --gradient-primary-horizontal: linear-gradient(
    94.6deg,
    #f4e9c9 0.27%,
    #d6ae3e 100%
  );
  --gradient-gray-to-black-horizontal: linear-gradient(
    87.9deg,
    #1f1f1f -0.01%,
    #000000 99.99%
  );

  --glow-primary: 0px 0px 10px 5px #dbb75133;
  --focus-primary-2px: 0px 0px 0px 2px #dbb75180;
  --focus-error-2px: 0px 0px 0px 2px #f7504f80;

  --radius-small: 8px;
  --radius-medium: 16px;
  --radius-large: 24px;

  /* Spacings */
  --spacing-xxs: 4px;
  --spacing-xs: 8px;
  --spacing-s: 12px;
  --spacing-m: 16px;
  --spacing-l: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  --spacing-xxxl: 56px;
}

/* Base */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

body {
  min-width: 320px;
  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-style: normal;
  color: var(--color-text-on-dark);
  background-color: var(--color-base);
}

button {
  border: none;
  background: none;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

input {
  border: none;
  outline: none;
  -webkit-appearance: none;
  -webkit-border-radius: 0;
  border-radius: 0;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus,
select:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0px 1000px var(--color-1) inset !important;
  -webkit-text-fill-color: var(--color-text-on-dark) !important;
}

/* Layout */
.container {
  display: flex;
  justify-content: space-between;
  min-height: 100vh;
}

.form-container {
  width: 728px;
  padding: var(--spacing-xxxl);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.form-container .logo {
  margin-bottom: var(--spacing-xxl);
}

.image-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

  background-image: var(--background-image);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top center;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (min--moz-device-pixel-ratio: 2),
  only screen and (-o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 2dppx) {
  .image-container {
    background-image: var(--background-image-x2);
  }
}

@media screen and (max-width: 1023px) {
  .form-container {
    width: 560px;
    padding: var(--spacing-xxl);
  }
}

@media screen and (max-width: 639px) {
  .form-container {
    width: 100%;
    padding: var(--spacing-l);
  }

  .form-container .logo {
    margin-bottom: var(--spacing-xl);
  }

  .image-container {
    display: none;
  }
}

.buttons-container {
  display: flex;
}

.buttons-container .btn-back {
  margin-right: var(--spacing-m);
}

/* Layout Steps */
.step-1,
.step-2,
.step-3,
.step-4,
.step-5,
.step-6,
.step-7,
.step-8,
body .btn-end {
  display: none;
}
body[data-step="1"] .step-1 {
  display: block;
}
body[data-step="2"] .step-2 {
  display: block;
}
body[data-step="3"] .step-3 {
  display: block;
}
body[data-step="4"] .step-4 {
  display: block;
}
body[data-step="5"] .step-5 {
  display: block;
}
body[data-step="6"] .step-6 {
  display: block;
}
body[data-step="7"] .step-7 {
  display: block;
}
body[data-step="8"] .step-8 {
  display: block;
}

body[data-step="8"] .progress-bar,
body[data-step="8"] .btn-back,
body[data-step="8"] .btn-next,
body[data-step="8"] header.logo {
  display: none;
}

body[data-step="8"] .btn-end {
  display: inline-flex;
}

/* Progress Bar */
.progress-bar .steps {
  display: flex;
  gap: var(--spacing-xs);
}

.progress-bar .step {
  width: 100%;
  height: 4px;
  background-color: var(--color-3);
  border-radius: 4px;
}

.progress-bar .step.active {
  background: var(--gradient-primary-horizontal);
}

/* Input Component */
.input-wrapper {
  position: relative;
}

.input-wrapper .validation-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.input-wrapper .validation-icon::before {
  content: "";
  position: absolute;
  right: 9px;
  width: 32px;
  height: 32px;
  background-repeat: no-repeat;
  background-position: center;
  top: 50%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
}

input,
textarea {
  display: flex;
  padding: 11px 16px;
  max-width: 100%;
  width: 100%;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--color-text-on-dark);
  border: solid 1px var(--color-3);
  border-radius: var(--radius-large);
  background-color: var(--color-1);
  resize: none;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  font-weight: 400;
  color: var(--color-placeholder-text);
}

input:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-primary-2px);
}

input.error,
textarea.error {
  border-color: var(--color-danger);
}

input.error:focus,
textarea.error:focus {
  box-shadow: var(--focus-error-2px);
}

label {
  display: inline-flex;
  margin-bottom: var(--spacing-xs);
  font-size: 16px;
  font-weight: 600;
  line-height: 19px;
}

label.error {
  margin-top: var(--spacing-xs);
  margin-bottom: 0;
  font-weight: 400;
  color: var(--color-error-text);
}

/* Button Component */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 12px 27px;
  min-width: 152px;
  background: var(--color-primary);
  background: var(--gradient-primary-horizontal);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 600;
  line-height: 19px;
  text-align: center;
  justify-content: center;
  color: var(--color-text-on-light);
  border-radius: var(--radius-large);
}

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

.btn:focus {
  box-shadow: var(--focus-primary-2px);
}

.btn.secondary {
  background: unset;
  color: var(--color-text-on-dark);
}

.btn.secondary:hover {
  background: var(--color-primary-15);
}

.btn.secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: var(--gradient-primary-horizontal);
  border-radius: var(--radius-large);
  padding: 1px;
  -webkit-mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}

.btn img:first-child {
  margin-right: var(--spacing-xs);
}

.btn img:last-child {
  margin-left: var(--spacing-xs);
}

/* Submitting state for the final "Записване" click. The label is hidden but
   still occupies its box (visibility, not display) so the button keeps its
   width and the layout doesn't jump while the request is in flight. */
.btn.is-busy {
  cursor: wait;
  pointer-events: none;
}

.btn.is-busy > * {
  visibility: hidden;
}

.btn.is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-text-on-light);
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Full-page shield during the final submit: blocks every click (including the
   browser-native Enter-on-focused-button path reaching another control) and
   signals that something is happening. */
.submit-shield {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  cursor: wait;
  background: rgba(0, 0, 0, 0.25);
}

.submit-shield.is-visible {
  display: block;
}

/* Checkbox Component */
.checkbox-wrapper {
  position: relative;
  padding-left: 48px;
  min-height: 48px;
  cursor: pointer;
}

.checkbox-wrapper .checkbox-text {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--color-text-on-dark);
}

.checkbox-wrapper .check-mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
}

.checkbox-wrapper .check-mark::before {
  content: "";
  width: 24px;
  height: 24px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
  border: solid 2px var(--color-white);
  border-radius: 2px;
  transition: all 0.2s ease-in-out;
}

.checkbox-wrapper .check-mark::after {
  content: "";
  width: 15px;
  height: 8px;
  position: absolute;
  border: 3px solid var(--color-text-on-light);
  left: calc(50% - 9px);
  top: calc(50% - 8px);
  transform: translate(-50%, -50%);
  border-left: none;
  border-bottom: none;
  opacity: 0;
  transform: rotate(90deg);
  transition: all 0.2s ease-in-out;
}

.checkbox-wrapper input {
  position: absolute;
  left: 0px;
  width: 16px;
  visibility: hidden;
}

.checkbox-wrapper input:checked + .check-mark:after {
  opacity: 1;
  transform: rotate(135deg);
}

.checkbox-wrapper input:checked + .check-mark:before {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
}

/* Select Component */
.select-wrapper {
  position: relative;
}

.select-wrapper::before {
  content: "";
  position: absolute;
  right: 16px;
  width: 15px;
  height: 24px;
  background-image: url("../img/apply/icons/arrow-down.svg");
  background-repeat: no-repeat;
  background-position: center;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.select-wrapper select {
  display: block;
  margin: 0;
  padding: 11px 16px;
  padding-right: 38px;
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-large);
  border: 1px solid var(--color-3);
  background-color: var(--color-1);
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: var(--color-text-on-dark);
  -moz-appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

.select-wrapper select:invalid {
  color: var(--color-placeholder-text);
  font-weight: 400;
}

.select-wrapper select:hover {
  border-color: var(--color-white);
}

.select-wrapper select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--focus-primary-2px);
}

.select-wrapper select.error {
  border-color: var(--color-danger);
}

.select-wrapper select:focus.error {
  box-shadow: var(--focus-error-2px);
}

.select-wrapper select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 #000;
}

/* Badge Styles */
.badge {
  background-color: var(--color-primary-15);
  color: var(--color-primary);
  padding: 2px 8px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  border-radius: var(--radius-small);
}

/* Radio */
.radio-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: baseline;
}

.radio-wrapper input {
  position: absolute;
  margin: 0;
  top: 0;
  left: 0;
  height: 44px;
  width: 44px;
  opacity: 0;
  height: 100%;
  pointer-events: none;
}

.radio-wrapper input ~ img:last-of-type {
  display: none;
}
.radio-wrapper input ~ img:first-of-type {
  display: inline-flex;
}

.radio-wrapper input:checked ~ img:first-of-type {
  display: none;
}
.radio-wrapper input:checked ~ img:last-of-type {
  display: inline-flex;
}

/* Toggle */
.toggle-wrapper {
  display: inline-flex;
  flex-direction: column;
}

.toggle-wrapper .toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 11px 0px;
  cursor: pointer;
}

.toggle-wrapper input {
  position: absolute;
  align-self: baseline;
  padding: 0;
  margin: 0;
  opacity: 0;
  z-index: -1;
}

.toggle-wrapper .slider {
  position: relative;
  border-radius: 34px;
  background-color: var(--color-5);
  flex-shrink: 0;
  transition-property: background-color;
  will-change: background-color;
}
.toggle-wrapper .slider::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 2px;
  border-radius: 50%;
  background-color: var(--color-white);
  transition-property: transform;
  will-change: transform;
}

.slider,
.slider::before {
  transition-duration: 200ms;
  transition-timing-function: ease;
}

.toggle-wrapper input:checked + .slider {
  background-color: var(--color-success);
}

.toggle-wrapper .toggle input,
.toggle-wrapper .toggle .slider {
  align-self: baseline;
  width: 48px;
  height: 26px;
}

.toggle-wrapper .toggle .slider::before {
  width: 22px;
  height: 22px;
}

.toggle-wrapper .toggle input:checked + .slider::before {
  transform: translateX(22px);
}

.toggle-wrapper .toggle-text {
  margin-left: var(--spacing-xs);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

/* Select Card Component */
.select-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--gradient-gray-to-black-horizontal);
  border-radius: var(--radius-medium);
  padding: var(--spacing-m);
}

.select-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  border: 1px solid var(--color-3);
  border-radius: var(--radius-medium);
  padding: 1px;
  pointer-events: none;
}

.select-card:hover::before,
.select-card.select-card-active::before {
  background: var(--gradient-primary-horizontal);
  -webkit-mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}

.select-card.select-card-active::before {
  padding: 2px;
}

.select-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: calc(var(--spacing-m) * -1);
  padding: var(--spacing-m);
  border-radius: var(--radius-medium);
  cursor: pointer;
}

.select-card-header .select-card-badge {
  margin-left: var(--spacing-s);
  width: 86px;
  height: 86px;
}

.select-card-info {
  flex-grow: 1;
  margin-left: var(--spacing-s);
}

.select-card-info .select-card-title {
  font-size: 20px;
  line-height: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.select-card-info .select-card-text-old {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--color-muted-text);
  text-decoration: line-through;
}

.select-card-info .select-card-subtitle {
  margin-top: var(--spacing-xxs);
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

.select-card-body {
  display: none;
  margin-top: var(--spacing-m);
  padding-left: 56px;
}

.select-card-section:not(:last-of-type) {
  margin-bottom: var(--spacing-m);
}

.select-card-section h4 {
  font-size: 16px;
  line-height: 20px;
}

.select-card-section p {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-muted-text);
}

/* Alert Component */
.alert {
  padding: var(--spacing-m);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-medium);
}

.alert .alert-title {
  display: flex;
  align-items: center;
}

.alert .alert-title h4 {
  margin-left: var(--spacing-xs);
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
}

.alert .alert-description {
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}

/* Certificate Card */
.certificate-card {
  position: relative;
  padding: var(--spacing-l);
  border-radius: var(--radius-medium);
  box-shadow: var(--glow-primary);
  text-align: center;

  background-image: url("../img/apply/certificate-card-bg.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
@media only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (min--moz-device-pixel-ratio: 2),
  only screen and (-o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 2dppx) {
  .certificate-card {
    background-image: url("../img/apply/certificate-card-bg@2x.png");
  }
}

.certificate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: var(--gradient-primary-horizontal);
  border-radius: var(--radius-medium);
  padding: 1px;
  -webkit-mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}

.certificate-card h1 {
  font-size: 31px;
  line-height: 42px;
  font-weight: 800;
}

.certificate-card h3 {
  font-size: 20px;
  line-height: 30px;
  font-weight: 800;
}

.certificate-card p {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--color-muted-text);
}

/* Vertical Steps */
.vertical-steps {
  display: flex;
  flex-direction: column;
}

.vertical-steps .vertical-step {
  position: relative;
  display: flex;
  align-items: center;
}

.vertical-steps .vertical-step .vertical-step-circle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  margin-right: var(--spacing-m);
}

.vertical-steps .vertical-step .vertical-step-line {
  width: 1px;
  min-height: var(--spacing-s);
  height: 100%;
  background: var(--color-primary);
  background: var(--gradient-primary-horizontal);
}

.vertical-steps .vertical-step:first-of-type .vertical-step-line:first-of-type,
.vertical-steps .vertical-step:last-of-type .vertical-step-line:last-of-type {
  opacity: 0;
}

.vertical-steps .vertical-step .vertical-step-circle {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-base);
}

.vertical-steps .vertical-step .vertical-step-circle::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background: var(--gradient-primary-horizontal);
  border-radius: 50%;
  padding: 1px;
  -webkit-mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  mask: var(--gradient-primary-horizontal) content-box,
    var(--gradient-primary-horizontal);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}

.vertical-steps .vertical-step .vertical-step-text {
  padding: var(--spacing-xs) 0px;
}

.vertical-steps .vertical-step .vertical-step-text h4 {
  margin-bottom: var(--spacing-xxs);
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
}

.vertical-steps .vertical-step .vertical-step-text p {
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
  color: var(--color-muted-text);
}

/* Custom element moving */
#cohort_id-error,
#participation-error,
#payment-error,
#method-error,
#warranty-error {
  position: relative;
  display: flex;
  margin-top: -24px;
  margin-bottom: 24px;
}
#payment-error {
  margin-top: -8px;
  margin-bottom: 16px;
}
#check2-error {
  margin: 0;
}

/* Utilities */
.mb-xxs {
  margin-bottom: var(--spacing-xxs) !important;
}

.mb-xs {
  margin-bottom: var(--spacing-xs) !important;
}

.mb-s {
  margin-bottom: var(--spacing-s) !important;
}

.mb-m {
  margin-bottom: var(--spacing-m) !important;
}

.mb-l {
  margin-bottom: var(--spacing-l) !important;
}

.mb-xl {
  margin-bottom: var(--spacing-xl) !important;
}

.mb-xxl {
  margin-bottom: var(--spacing-xxl) !important;
}

.mb-xxxl {
  margin-bottom: var(--spacing-xxxl) !important;
}

.text-uppercase {
  text-transform: uppercase;
}

.step-title {
  font-weight: 700;
  font-size: 31px;
  line-height: 38px;
}

.step-subtitle {
  font-weight: 600;
  font-size: 25px;
  line-height: 33px;
}

.step-text {
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
}

.bg-glow {
  text-align: center;
  padding: 50px 24px;
  margin: -50px -24px;

  background-image: url("../img/apply/bg-glow.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
.bg-glow.bg-glow-success {
  background-image: url("../img/apply/bg-glow-success.png");
}
@media only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (min--moz-device-pixel-ratio: 2),
  only screen and (-o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 2dppx) {
  .bg-glow {
    background-image: url("../img/apply/bg-glow@2x.png");
  }
  .bg-glow.bg-glow-success {
    background-image: url("../img/apply/bg-glow-success@2x.png");
  }
}

.bg-glow img {
  margin: var(--spacing-m) 0;
}

.d-inline-flex {
  display: inline-flex;
}
