/**
 * Register Form Styles
 * Dedicated CSS for registration form with consistent design system
 * Design tokens: 4px base spacing, 48px input height, 12px border radius
 */

/* Form container */
.reg-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Field structure */
.reg-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reg-form__label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.01em;
}

/* Input and select base styles */
.reg-form__input,
.reg-form__select {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 13, 26, 0.65);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}

.reg-form__input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.reg-form__input:focus,
.reg-form__select:focus {
  outline: none;
  border-color: rgba(var(--tint-color), 0.6);
  background: rgba(12, 18, 32, 0.75);
  box-shadow: 0 0 0 3px rgba(var(--tint-color), 0.12);
}

.reg-form__input:disabled,
.reg-form__select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Select specific styles */
.reg-form__select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  cursor: pointer;
}

/* Phone field group - unified code + number */
.reg-form__field--phone {
  gap: 8px;
}

.reg-form__phone-group {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
}

.reg-form__phone-group .reg-form__select {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.reg-form__phone-group .reg-form__input {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Focus states for phone group */
.reg-form__phone-group .reg-form__select:focus {
  position: relative;
  z-index: 2;
  border-right: 1px solid rgba(var(--tint-color), 0.6);
}

.reg-form__phone-group .reg-form__input:focus {
  position: relative;
  z-index: 2;
}

/* Two-column row for preferences */
.reg-form__row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .reg-form__row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Error messages */
.reg-form__error {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  color: #ff6b6b;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

.reg-form__error.v1-1-error-active {
  min-height: auto;
  max-height: 60px;
  opacity: 1;
  margin-top: 4px;
  transform: translateY(0);
}

.reg-form__input.v1-1-input-error,
.reg-form__select.v1-1-input-error {
  border-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.08);
}

.reg-form__input.v1-1-input-error:focus,
.reg-form__select.v1-1-input-error:focus {
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

/* Success state */
.reg-form__input.v1-1-input-success,
.reg-form__select.v1-1-input-success {
  border-color: rgba(74, 222, 128, 0.6);
  background: rgba(74, 222, 128, 0.05);
}

.reg-form__input.v1-1-input-success:focus,
.reg-form__select.v1-1-input-success:focus {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.12);
}

/* Password hints */
.reg-form__hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.reg-form__hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(8, 13, 26, 0.6);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s ease;
}

.reg-form__hint::before {
  content: "○";
  font-size: 8px;
  opacity: 0.5;
}

.reg-form__hint.is-valid {
  color: rgba(74, 222, 128, 0.9);
}

.reg-form__hint.is-valid::before {
  content: "●";
  opacity: 1;
}

/* Consent checkbox */
.reg-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 16, 30, 0.5);
  margin-top: 4px;
}

.reg-form__checkbox {
  flex-shrink: 0;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 13, 26, 0.6);
  appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.reg-form__checkbox:checked {
  background: rgba(var(--tint-color), 0.7);
  border-color: rgba(var(--tint-color), 0.9);
}

.reg-form__checkbox:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: #fff;
  border-radius: 3px;
}

.reg-form__checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--tint-color), 0.15);
}

.reg-form__consent-label {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}

.reg-form__consent-label a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.2s ease;
}

.reg-form__consent-label a:hover {
  opacity: 0.8;
}

/* Action buttons */
.reg-form__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.reg-form__actions .btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.reg-form__actions .btn-primary {
  background: linear-gradient(135deg, var(--action-1), var(--action-2));
  border: none;
  color: var(--action-text);
  box-shadow: 0 12px 28px var(--action-shadow);
}

.reg-form__actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px var(--action-shadow);
  filter: brightness(1.03);
}

.reg-form__actions .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.reg-form__actions .btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

.reg-form__actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Error message below button */
.reg-form > .reg-form__error.answer {
  margin-top: 0;
}


/* Mobile responsive adjustments */
@media (max-width: 639px) {
  .reg-form__phone-group {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .reg-form__phone-group .reg-form__select,
  .reg-form__phone-group .reg-form__input {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
  }

  .reg-form__phone-group .reg-form__select:focus {
    border: 1px solid rgba(var(--tint-color), 0.6);
  }
}

/* Loading state */
.reg-form.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.reg-form.is-loading .btn-primary::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Turnstile widget styles */
.reg-form__field--turnstile {
  margin-top: 4px;
  margin-bottom: 8px;
}

.reg-form__field--turnstile .cf-turnstile {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Ensure Turnstile error follows the same pattern */
.reg-form__error.turnstile-error {
  margin-top: 8px;
  text-align: center;
}

/* ============================================
   NETFLIX-STYLE IMMERSIVE REGISTRATION
   ============================================ */

/* Override body padding for register page - use CSS variable for header height */
.layout-register-netflix.layout-main {
  padding-top: var(--topbar-height, 88px);
}

/* Full-screen background */
.register-netflix {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.register-netflix__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.register-netflix__bg picture,
.register-netflix__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.register-netflix__overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(135deg, rgba(5, 10, 25, 0.92) 0%, rgba(10, 20, 40, 0.75) 40%, rgba(5, 10, 25, 0.88) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.6) 100%);
}

/* Main content layout */
.register-netflix__content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr minmax(380px, 480px);
  gap: 32px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 40px 48px;
  align-items: start;
}

/* Hero section - Left side (sticky on scroll) */
.register-hero {
  display: flex;
  align-items: center;
  padding: 32px 0;
  position: sticky;
  top: calc(var(--topbar-height, 88px) + 24px);
  align-self: start;
  height: fit-content;
}

.register-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 580px;
}

/* Eyebrow tag */
.register-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(251, 191, 36, 0.12));
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: fit-content;
  animation: tagPulse 2s ease-in-out infinite;
}

.register-hero__tag svg {
  color: #fbbf24;
}

@keyframes tagPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 0 24px 4px rgba(251, 191, 36, 0.2); }
}

/* Main headline */
.register-hero__headline {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.register-hero__percent {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shineText 4s ease-in-out infinite;
}

@keyframes shineText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.register-hero__subline {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.01em;
}

/* Bonus details */
.register-hero__details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.register-hero__detail {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.register-hero__detail-icon {
  font-size: 20px;
}

.register-hero__detail-text {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

/* Extra perks */
.register-hero__perks {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.register-hero__perk {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(251, 191, 36, 0.04));
  border: 1px solid rgba(251, 191, 36, 0.25);
  flex: 1;
  max-width: 220px;
}

.register-hero__perk-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.register-hero__perk-badge--icon {
  font-size: 20px;
}

.register-hero__perk-badge--game {
  width: 48px;
  height: 48px;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  background: none;
}

.register-hero__perk-badge--game img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.register-hero__perk-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.register-hero__perk-content strong {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.register-hero__perk-content small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

/* Social proof */
.register-hero__proof {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.register-hero__avatars {
  display: flex;
  align-items: center;
}

.register-hero__avatars img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  object-fit: cover;
}

.register-hero__avatars img + img {
  margin-left: -10px;
}

.register-hero__avatar-count {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -10px;
  padding: 0 12px;
  height: 36px;
  border-radius: 18px;
  background: rgba(10, 20, 40, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.register-hero__proof p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 200px;
}

/* Registration card - Right side */
.register-card {
  padding: 32px 36px;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  justify-self: end;
}

.register-card__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.register-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

/* Mobile bonus reminder - hidden on desktop */
.reg-form__bonus-reminder {
  display: none;
}

.bonus-reminder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.bonus-reminder__icon {
  font-size: 28px;
  flex-shrink: 0;
}

.bonus-reminder__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bonus-reminder__title {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
}

.bonus-reminder__text {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
  .register-netflix__content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px 32px 32px;
    align-items: start;
  }

  .register-hero {
    text-align: center;
    justify-content: center;
  }

  .register-hero__inner {
    align-items: center;
    max-width: 100%;
  }

  .register-hero__details {
    justify-content: center;
  }

  .register-hero__perks {
    justify-content: center;
  }

  .register-hero__proof {
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }

  .register-card {
    justify-self: center;
    max-width: 520px;
  }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .register-netflix__content {
    padding: 16px 16px 24px;
    gap: 0;
  }

  .register-hero__inner {
    gap: 14px;
  }

  .register-hero__tag {
    font-size: 11px;
    padding: 6px 12px;
  }

  .register-hero__percent {
    font-size: 48px;
  }

  .register-hero__subline {
    font-size: 16px;
  }

  .register-hero__details {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .register-hero__detail {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .register-hero__perks {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .register-hero__perk {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  /* Hide entire hero section on mobile - only show reminder in form */
  .register-hero {
    display: none;
  }

  .register-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .register-card__title {
    font-size: 20px;
  }

  /* Show mobile bonus reminder */
  .reg-form__bonus-reminder {
    display: block;
    margin-bottom: 4px;
  }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
  .register-netflix__content {
    padding: 80px 16px 20px;
  }

  .register-hero__percent {
    font-size: 52px;
  }

  .register-hero__subline {
    font-size: 16px;
  }

  .register-card {
    padding: 20px 16px;
  }

  .bonus-reminder {
    padding: 12px;
  }
}

/* Hide old register-shell styles when using Netflix layout */
.layout-register-netflix .register-shell,
.layout-register-netflix .register-layout,
.layout-register-netflix .register-experience,
.layout-register-netflix .register-panel {
  display: none !important;
}
