/* Authentication and Verification Modal Styles (BEM) */

.auth-modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.auth-modal__overlay.auth-modal__overlay--visible {
  opacity: 1;
  visibility: visible;
}

.auth-modal__dialog {
  background: white;
  border-radius: 0;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.auth-modal__overlay.auth-modal__overlay--visible .auth-modal__dialog {
  transform: scale(1) translateY(0);
}

.auth-modal__header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #dee2e6;
}

.auth-modal__title {
  margin: 0;
  font-size: 1.8em;
  font-weight: 600;
  color: #2c3e50;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 1px;
  text-align: center;
}

.auth-modal__brand {
  font-family: 'Permanent Marker', cursive;
  font-weight: 400;
  letter-spacing: 2px;
}

.auth-modal__close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: all 0.2s ease;
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
}

.auth-modal__close:hover {
  background: transparent;
  color: #2f2d2d;
  transform: translateY(-50%) scale(1.1);
  box-shadow: none;
}

.auth-modal__close--verification {
  top: 20px;
  right: 15px;
  z-index: 10001;
  transform: none;
}

.auth-modal__close--verification:hover {
  transform: scale(1.1);
}

.auth-modal__content {
  padding: 24px;
}

.auth-modal__alert {
  background: #f8d7da;
  color: #721c24;
  padding: 12px 16px;
  border-radius: 0;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
  font-size: 0.9em;
  font-family: 'Crimson Text', 'Georgia', serif;
}

.auth-modal__alert--success {
  background-color: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.auth-modal__form {
  margin-bottom: 24px;
}

.auth-modal__form-group {
  display: block;
  margin-bottom: 20px;
}

.auth-modal__label {
  display: block;
  margin-bottom: 6px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  font-size: 0.9em;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 0.5px;
}

.auth-modal__input,
.auth-modal__select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 0;
  font-size: 1em;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 0.5px;
}

.auth-modal__input:focus,
.auth-modal__select:focus {
  outline: none;
  border-color: #007bff;
}

.auth-modal__input:disabled,
.auth-modal__select:disabled {
  background: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

.auth-modal__submit {
  width: 100%;
  padding: 14px;
  background: #2f2d2d;
  color: white;
  border: none;
  border-radius: 0;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 1px;
}

.auth-modal__submit:hover:not(:disabled) {
  background: #2f2d2d;
  color: white;
  transform: none;
  opacity: 0.8;
}

.auth-modal__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-modal__submit.auth-modal__submit--loading {
  color: transparent;
}

.auth-modal__submit.auth-modal__submit--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff40;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-modal-spinner 1s linear infinite;
}

@keyframes auth-modal-spinner {
  to {
    transform: rotate(360deg);
  }
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: #6c757d;
  font-size: 0.9em;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dee2e6;
}

.auth-modal__divider-text {
  padding: 0 16px;
}

.auth-modal__google-button {
  width: 100%;
  padding: 12px;
  background: white;
  color: #495057;
  border: 2px solid #dee2e6;
  border-radius: 0;
  font-size: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 0.5px;
}

.auth-modal__google-button:hover:not(:disabled) {
  background: #f8f9fa;
  color: #495057;
  border-color: #adb5bd;
}

.auth-modal__google-button:disabled,
.auth-modal__google-button.auth-modal__google-button--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-modal__google-icon {
  width: 18px;
  height: 18px;
}

.auth-modal__switch {
  text-align: center;
  color: #6c757d;
  font-size: 1rem;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 0.5px;
}

.auth-modal__switch-button {
  background: none;
  border: none;
  color: #2f2d2d;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 1.2em;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.auth-modal__switch-button:hover {
  background: none;
  border: none;
  color: #2f2d2d;
  text-shadow: 0 0 8px rgba(47, 45, 45, 0.6);
  transform: none;
  box-shadow: none;
}

.auth-modal__terms-copy {
  margin-bottom: 20px;
  color: #2f2d2d;
  font-size: 1.1em;
  line-height: 1.6;
  font-family: 'Crimson Text', 'Georgia', serif;
  text-align: center;
}

.auth-modal__terms-links {
  text-align: center;
  margin-bottom: 30px;
}

.auth-modal__terms-link {
  text-decoration: underline;
}

.auth-modal__terms-link--spaced {
  margin-right: 20px;
}

.auth-modal__terms-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.auth-modal__terms-action {
  flex: 1;
  max-width: 150px;
}

.auth-modal__terms-pending {
  width: 100%;
  text-align: center;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #2f2d2d;
  padding: 0.75rem 0;
}

.auth-modal__forgot-copy {
  margin-bottom: 20px;
  color: #666;
  font-size: 0.95em;
  line-height: 1.5;
  font-family: 'Crimson Text', 'Georgia', serif;
}

.auth-modal__login-required-copy {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.1em;
  color: #2c3e50;
  font-family: 'Crimson Text', 'Georgia', serif;
  letter-spacing: 0.5px;
}

.auth-modal__login-required-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.auth-modal__email-display {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0;
  padding: 12px 16px;
  font-family: 'Courier New', monospace;
  font-weight: 500;
  color: #2f2d2d;
  text-align: center;
  margin: 0;
}

.auth-modal__verification-info {
  text-align: center;
  margin: 20px 0;
}

.auth-modal__verification-copy {
  margin: 15px 0;
  color: #555;
  line-height: 1.5;
  font-family: 'Crimson Text', 'Georgia', serif;
}

.auth-modal__verification-actions {
  margin: 25px 0 15px;
}

.auth-modal__dialog--welcome {
  position: relative;
  max-width: 500px;
  max-height: min(90vh, 760px);
  border-radius: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(30, 22, 16, 0.32);
}

.post-registration-welcome-modal__confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}

.post-registration-welcome-modal__confetti-layer.post-registration-welcome-modal__confetti-layer--active {
  opacity: 1;
}

.post-registration-welcome-modal__confetti-piece {
  position: absolute;
  top: -10%;
  left: var(--confetti-x, 50%);
  width: var(--confetti-size, 8px);
  height: calc(var(--confetti-size, 8px) * 1.6);
  background: var(--confetti-color, #ffd166);
  border-radius: 2px;
  opacity: 0;
  transform: translate3d(0, -12vh, 0) rotate(0deg);
  animation:
    post-registration-welcome-confetti-fall var(--confetti-duration, 4s) cubic-bezier(0.16, 0.84, 0.3, 1) forwards,
    post-registration-welcome-confetti-spin calc(var(--confetti-duration, 4s) * 0.5) linear infinite;
  animation-delay: var(--confetti-delay, 0s), var(--confetti-delay, 0s);
}

@keyframes post-registration-welcome-confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -12vh, 0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--confetti-tilt, 0) * 190px), 118vh, 0) rotate(680deg);
  }
}

@keyframes post-registration-welcome-confetti-spin {
  0% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(1.15);
  }
  100% {
    filter: saturate(1);
  }
}

.post-registration-welcome-modal__hero {
  position: relative;
  padding: 18px 28px 20px;
  color: #f7f2ea;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 54px, transparent 55px),
    radial-gradient(circle at 85% 88%, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 30px, transparent 31px),
    linear-gradient(180deg, #29211c 0%, #211915 100%);
}

.post-registration-welcome-modal__eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(
    110deg,
    #8e7b68 0%,
    #8e7b68 38%,
    #f0eee8 50%,
    #8e7b68 62%,
    #8e7b68 100%
  );
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: post-registration-welcome-shimmer 6.8s linear infinite;
}

.post-registration-welcome-modal__title {
  margin: 0;
  font-family: 'Crimson Text', 'Georgia', serif;
  font-size: 2.3rem;
  line-height: 1;
  font-weight: 700;
  background: linear-gradient(
    110deg,
    #f4ede3 0%,
    #f4ede3 38%,
    #ffffff 50%,
    #f4ede3 62%,
    #f4ede3 100%
  );
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: post-registration-welcome-shimmer 7.4s linear infinite;
}

@keyframes post-registration-welcome-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -40% 0;
  }
}

.post-registration-welcome-modal__subtitle {
  max-width: 360px;
  margin: 10px 0 0;
  color: #ccb9a5;
  font-size: 1rem;
  line-height: 1.5;
}

.post-registration-welcome-modal__body {
  padding: 14px 28px 18px;
  background: #ffffff;
}

.post-registration-welcome-modal__section-label {
  margin: 0 0 12px;
  color: #a99679;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-registration-welcome-modal__feature-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-registration-welcome-modal__feature-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  background: #ffffff;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 0;
  font-family: 'Crimson Text', 'Georgia', serif;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.post-registration-welcome-modal__feature-card:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.14);
}

.post-registration-welcome-modal__feature-card:active {
  transform: none;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .post-registration-welcome-modal__feature-card:hover {
    transform: scale(1.01);
    box-shadow: none;
  }
}

.post-registration-welcome-modal__feature-card--modules {
  border-color: rgba(0, 0, 0, 0.14);
}

.post-registration-welcome-modal__feature-card--challenges {
  border-color: rgba(0, 0, 0, 0.14);
}

.post-registration-welcome-modal__feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  background: #f2ece4;
  font-size: 1rem;
}

.post-registration-welcome-modal__feature-copy {
  min-width: 0;
}

.post-registration-welcome-modal__feature-title {
  margin: 0 0 2px;
  color: #000000;
  font-size: 1.08rem;
  font-weight: 700;
  font-family: 'Crimson Text', 'Georgia', serif;
}

.post-registration-welcome-modal__feature-text {
  margin: 0;
  color: #000000;
  font-size: 0.94rem;
  line-height: 1.35;
  font-family: 'Crimson Text', 'Georgia', serif;
}

.post-registration-welcome-modal__trial-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  color: #6d5f52;
  background: #f1eae0;
  border: 1px solid #d7cab8;
  border-radius: 10px;
}

.post-registration-welcome-modal__trial-icon {
  color: #8d7b65;
  font-size: 1rem;
  line-height: 1.4;
}

.post-registration-welcome-modal__trial-copy {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
}

.trial-ended-modal__dialog {
  position: relative;
  max-width: 360px;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.trial-ended-modal__content {
  padding: 34px 30px 24px;
}

.trial-ended-modal__close {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 36px;
  border: 1px solid rgba(47, 45, 45, 0.22);
  border-radius: 8px;
  color: #2f2d2d;
  background: #ffffff;
  transform: none;
}

.trial-ended-modal__close:hover {
  background: #2f2d2d;
  color: #ffffff;
  transform: none;
}

.trial-ended-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f0dcc0;
  color: #8b5a21;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trial-ended-modal__title {
  margin: 0 0 14px;
  font-family: inherit;
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.1;
  color: #1f1a17;
  text-align: center;
}

.trial-ended-modal__copy {
  text-align: center;
  margin-bottom: 24px;
}

.trial-ended-modal__message {
  margin: 0;
  font-size: 1.05rem;
  color: #3f3a36;
  line-height: 1.5;
}

.trial-ended-modal__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.trial-ended-modal__action {
  padding: 13px 18px;
  border: 1px solid rgba(47, 45, 45, 0.22);
  border-radius: 10px;
  background: #ffffff;
  color: #2f2d2d;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
}

.trial-ended-modal__action:hover:not(:disabled) {
  background: #2f2d2d;
  color: #ffffff;
  opacity: 1;
}

.trial-ended-modal__action--secondary {
  background: #ffffff;
}

.post-registration-welcome-modal__pricing-link {
  display: inline;
  margin: 0 0.2ch;
  padding: 0;
  color: #6d5231;
  background: none;
  border: none;
  border-bottom: 1px solid currentColor;
  font: inherit;
  cursor: pointer;
}

.post-registration-welcome-modal__primary {
  margin-top: 14px;
  border-radius: 10px;
  font-size: 1.15rem;
}

.post-registration-welcome-modal__pricing-link:hover,
.post-registration-welcome-modal__pricing-link:focus-visible {
  color: #4f3920;
}

@media (max-width: 640px) {
  .auth-modal__dialog--welcome {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
  }

  .post-registration-welcome-modal__hero {
    padding: 18px 20px 18px;
  }

  .post-registration-welcome-modal__body {
    padding: 14px 20px 18px;
  }

  .post-registration-welcome-modal__title {
    font-size: 1.9rem;
  }

  .post-registration-welcome-modal__feature-card {
    padding: 12px 0;
  }

  .post-registration-welcome-modal__confetti-piece {
    width: max(6px, var(--confetti-size, 8px));
  }

  .post-registration-welcome-modal__feature-text,
  .post-registration-welcome-modal__subtitle,
  .post-registration-welcome-modal__trial-copy {
    font-size: 0.94rem;
  }

  .trial-ended-modal__dialog {
    width: calc(100% - 24px);
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 1023px) and (orientation: landscape) {
  .trial-ended-modal__overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 16px;
  }

  .trial-ended-modal__dialog {
    width: min(360px, 100%);
    max-height: calc(100vh - 32px);
    margin: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
