/* Auth screens (login/recovery) */
.auth-shell,
.auth-shell *{
  box-sizing: border-box;
}

.auth-shell{
  min-height: calc(100dvh - 110px);
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(22px, env(safe-area-inset-bottom));
  display: grid;
  align-content: center;
  gap: 12px;
}

.auth-topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 12px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(30, 58, 94, .85);
  background: rgba(7, 15, 29, .72);
}

.auth-brand{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.auth-brand__logo{
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(54, 101, 158, .6);
  background: rgba(9, 20, 36, .8);
  padding: 4px;
}

.auth-brand__title{
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #e8f0ff;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-lang{
  margin: 0;
  flex: 0 0 auto;
}

.auth-lang__select{
  min-width: 126px;
  max-width: 150px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(54, 101, 158, .7);
  background: rgba(10, 22, 38, .9);
  color: #e8f0ff;
  padding: 0 10px;
  font-size: 13px;
}

.auth-card{
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(30, 58, 94, .9);
  background:
    radial-gradient(100% 80% at 85% 5%, rgba(22, 163, 74, .18) 0%, rgba(22, 163, 74, 0) 65%),
    radial-gradient(95% 70% at 15% 0%, rgba(59, 130, 246, .22) 0%, rgba(59, 130, 246, 0) 68%),
    linear-gradient(180deg, rgba(8, 16, 28, .95), rgba(2, 8, 18, .98));
  box-shadow: 0 14px 40px rgba(2, 8, 18, .45);
  padding: 18px 14px 16px;
}

.auth-title{
  margin: 0 0 14px;
  font-size: clamp(32px, 4.8vw, 42px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: #f3f7ff;
}

.auth-form{
  gap: 12px;
}

.auth-form .field{
  gap: 7px;
}

.auth-form .field__label{
  font-size: 14px;
  color: #d5e4ff;
}

.auth-form .field__required{
  color: #ff8f8f;
  font-weight: 800;
}

.auth-form .input{
  width: 100%;
  min-height: 56px;
  border-color: rgba(30, 84, 146, .9);
  background: linear-gradient(90deg, rgba(16, 31, 50, .9), rgba(18, 45, 36, .65));
}

.auth-form .input::placeholder{
  color: rgba(196, 211, 232, .7);
}

.auth-form .btn--big{
  min-height: 54px;
}

.auth-password-strength{
  margin: 2px 0 4px;
}

.auth-password-strength__label{
  margin: 0 0 6px;
  font-size: 13px;
  color: #c8d7ef;
}

.auth-password-strength__label strong{
  margin-left: 4px;
  font-weight: 800;
}

.auth-password-strength__track{
  position: relative;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(102, 153, 255, .35);
  background: rgba(9, 20, 36, .72);
  overflow: hidden;
}

.auth-password-strength__fill{
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  transition: width .16s ease, background-color .16s ease;
  background: #64748b;
}

.auth-password-strength[data-level="weak"] .auth-password-strength__fill{
  background: #ef4444;
}

.auth-password-strength[data-level="medium"] .auth-password-strength__fill{
  background: #f59e0b;
}

.auth-password-strength[data-level="strong"] .auth-password-strength__fill{
  background: #22c55e;
}

.auth-alert{
  margin-bottom: 10px;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(102, 153, 255, .35);
  background: rgba(15, 26, 40, .7);
  color: #e9f2ff;
  font-size: 14px;
}

.auth-alert.alert--err{
  border-color: rgba(239, 68, 68, .55);
  background: rgba(81, 18, 26, .45);
}

.auth-alert.alert--warn{
  border-color: rgba(245, 158, 11, .55);
  background: rgba(88, 54, 12, .45);
}

.auth-alert.alert--success{
  border-color: rgba(34, 197, 94, .6);
  background: rgba(20, 71, 49, .45);
}

.auth-hint{
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #c8d7ef;
}

.auth-hint a{
  color: #8fcbff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 460px){
  .auth-shell{
    width: 100%;
    padding-inline: 10px;
    min-height: calc(100dvh - 24px);
    align-content: start;
  }

  .auth-card{
    border-radius: 16px;
    padding: 16px 12px 14px;
  }

  .auth-topbar{
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    margin: 2px 0 10px;
    padding: 8px;
  }

  .auth-brand{
    width: 100%;
  }

  .auth-lang{
    width: 100%;
  }

  .auth-brand__logo{
    width: 40px;
    height: 40px;
  }

  .auth-brand__title{
    font-size: 13px;
  }

  .auth-lang__select{
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    font-size: 12px;
  }

  .auth-title{
    margin-bottom: 12px;
    font-size: clamp(28px, 8vw, 36px);
  }

  .subscribe-shell .auth-brand{
    align-items: center;
    gap: 8px;
  }

  .subscribe-shell .subscribe-brand__logo{
    width: 124px;
    height: 50px;
  }

  .subscribe-shell .auth-brand__title{
    min-width: 0;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

/* Public subscribe */
.subscribe-shell{
  width: min(920px, 100%);
}

.subscribe-card{
  padding-bottom: 20px;
}

.subscribe-form{
  gap: 14px;
}

.subscribe-actions{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.subscribe-actions__group{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subscribe-actions__btn{
  width: 100%;
}

.subscribe-actions__microcopy{
  margin: 0;
  min-height: 2.7em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .86rem;
  line-height: 1.35;
  color: rgba(239, 255, 244, .82);
}

.subscribe-actions .btn--secondary{
  border-color: rgba(34, 197, 94, .72);
  background: rgba(34, 197, 94, .22);
  color: #effff4;
}

.subscribe-actions .btn--secondary:hover{
  border-color: rgba(74, 222, 128, .9);
  background: rgba(34, 197, 94, .32);
}

.subscribe-actions .btn--secondary:focus-visible{
  outline-color: rgba(74, 222, 128, .9);
}

.subscribe-secure-payment{
  margin: 14px auto 6px;
  width: min(100%, 420px);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  border: 1px solid rgba(160, 192, 224, .28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(232, 241, 249, .96), rgba(212, 226, 240, .9)),
    radial-gradient(circle at top, rgba(255, 255, 255, .72), transparent 62%);
  box-shadow: 0 14px 28px rgba(1, 8, 18, .18);
}

.subscribe-secure-payment__image{
  display: block;
  width: clamp(260px, 72%, 360px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 8px 16px rgba(38, 61, 90, .12));
}

.subscribe-secure-payment__note{
  margin: 0;
  max-width: 34ch;
  text-align: center;
  color: rgba(18, 38, 60, .82);
  font-size: .88rem;
  line-height: 1.4;
}

.subscribe-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.subscribe-shell .auth-brand{
  gap: 14px;
  align-items: center;
}

.subscribe-shell .subscribe-brand__logo{
  width: 180px;
  height: 72px;
  padding: 0;
  border: 0;
  background: transparent;
  object-fit: contain;
}

.subscribe-shell .auth-brand__title{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .015em;
  color: #eaf3ff;
}

.subscribe-form select.input{
  color: #eef6ff;
  border-color: rgba(63, 127, 198, .95);
  background: linear-gradient(90deg, rgba(12, 32, 54, .96), rgba(17, 46, 38, .8));
  font-weight: 600;
  -webkit-text-fill-color: #eef6ff;
}

.subscribe-form select.input:focus{
  outline: none;
  border-color: rgba(130, 188, 255, .95);
  box-shadow: 0 0 0 2px rgba(80, 154, 255, .2);
}

.subscribe-form select.input option{
  color: #eaf3ff;
  background: #0b1a2d;
}

.subscribe-billing{
  grid-column: 1 / -1;
}

.subscribe-billing__cards{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.subscribe-billing__card{
  display: block;
  border: 1px solid rgba(120, 170, 230, .5);
  border-radius: 12px;
  background: rgba(13, 27, 44, .75);
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.subscribe-billing__card input{
  margin-right: 8px;
  accent-color: #4f9dff;
}

.subscribe-billing__text{
  color: #eaf3ff;
  font-weight: 600;
  font-size: 14px;
}

.subscribe-billing__card input:checked + .subscribe-billing__text{
  color: #bfe3ff;
}

.subscribe-billing__card input:focus-visible{
  outline: 2px solid rgba(138, 196, 255, .95);
  outline-offset: 2px;
}

.subscribe-billing__savings{
  margin: 10px 0 0;
  color: #9fd0ff;
  font-size: 13px;
  font-weight: 600;
}

.subscribe-legal{
  grid-column: 1 / -1;
  border: 1px solid rgba(120, 170, 230, .45);
  border-radius: 12px;
  background: rgba(10, 24, 40, .72);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.subscribe-legal__check{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #e8f1ff;
  font-size: 14px;
  line-height: 1.45;
}

.subscribe-legal__check input{
  margin-top: 2px;
  accent-color: #4f9dff;
}

.subscribe-legal__check a{
  color: #9ad2ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.subscribe-legal__summary-link{
  width: fit-content;
  border: 0;
  background: transparent;
  color: #8dc8ff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
}

.subscribe-legal__summary{
  border-radius: 10px;
  border: 1px solid rgba(120, 170, 230, .32);
  background: rgba(7, 18, 31, .72);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.subscribe-legal__summary p{
  margin: 0;
  color: #d9e8ff;
  font-size: 13px;
  line-height: 1.45;
}

.subscribe-legal__check--optional{
  color: #cfe1f8;
}

.subscribe-legal__error{
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, .55);
  background: rgba(81, 18, 26, .45);
  color: #ffd7d7;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 10px;
}

.subscribe-field-error{
  margin: 2px 0 0;
  color: #ffd7d7;
  font-size: 13px;
  line-height: 1.35;
}

.auth-form .input.input--error{
  border-color: rgba(239, 68, 68, .78);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .16);
}

.subscribe-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 1200;
}

.subscribe-modal.is-open{
  display: flex;
}

.subscribe-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, .74);
  backdrop-filter: blur(2px);
}

.subscribe-modal__panel{
  position: relative;
  width: min(480px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(97, 154, 230, .65);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(29, 178, 113, .18) 0%, rgba(29, 178, 113, 0) 62%),
    linear-gradient(180deg, rgba(10, 22, 39, .98), rgba(4, 12, 24, .98));
  box-shadow: 0 18px 52px rgba(2, 8, 18, .6);
  padding: 14px;
  z-index: 1;
  outline: none;
}

.subscribe-modal__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.subscribe-modal__title{
  margin: 0;
  color: #f2f7ff;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.01em;
}

.subscribe-modal__close{
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(132, 181, 243, .55);
  background: rgba(9, 23, 40, .9);
  color: #d9e8ff;
  font-size: 18px;
  cursor: pointer;
}

.subscribe-modal__desc{
  margin: 12px 0 0;
  color: #dbeaff;
  font-size: 15px;
  line-height: 1.45;
}

.subscribe-modal__desc--legal{
  display: grid;
  gap: 10px;
}

.subscribe-modal__desc--legal p{
  margin: 0;
}

.subscribe-modal__legal-foot{
  font-size: 14px;
  color: #cee3ff;
}

.subscribe-modal__legal-foot a{
  color: #9cd4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.subscribe-modal__foot{
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

body.subscribe-modal-open{
  overflow: hidden;
}

@media (max-width: 700px){
  .subscribe-grid{
    grid-template-columns: 1fr;
  }

  .subscribe-actions{
    grid-template-columns: 1fr;
  }

  .subscribe-secure-payment{
    margin-top: 16px;
    padding: 12px 14px;
    gap: 10px;
  }

  .subscribe-secure-payment__image{
    width: min(100%, 320px);
  }

  .subscribe-secure-payment__note{
    max-width: 30ch;
    font-size: .84rem;
  }

  .subscribe-billing__cards{
    grid-template-columns: 1fr;
  }

  .subscribe-shell .auth-brand{
    gap: 10px;
  }

  .subscribe-shell .subscribe-brand__logo{
    width: 150px;
    height: 60px;
  }

  .subscribe-shell .auth-brand__title{
    font-size: 15px;
    letter-spacing: .01em;
  }

  .subscribe-modal__panel{
    padding: 12px;
  }

  .subscribe-modal__title{
    font-size: 19px;
  }
}
