/*=============================================
=    Register Multi-Step Flow — Styles          =
=    Load order: Bootstrap → app-colors → this  =
=    ALL colors via --color-* variables         =
=    Only #fff is hardcoded (card bg + btn txt) =
=============================================*/

/* ---------- Page Background ---------- */
.bg-login {
  margin: 0;
  background: var(--color-background) url('../images/bg-login.svg') center / cover no-repeat fixed;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Noscript Banner ---------- */
noscript .noscript-banner {
  display: block;
}

.noscript-banner {
  display: none;
  background: var(--color-yellow-bg);
  color: var(--color-yellow-text);
  text-align: center;
  padding: 10px;
  font-size: 0.88rem;
  border-bottom: 2px solid var(--color-yellow-text);
  width: 100%;
}

/* ---------- Container & Card ---------- */
.register-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  width: 100%;
}

.register-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 1154px;
  overflow: hidden;

  /* Card entrance animation */
  animation: registerCardIn 0.5s ease-out both;
}

/* ---------- Logo Header (full-width above columns) ---------- */
.register-logo-header {
  padding: 24px 40px 16px;
}

.register-logo-header img {
  height: 40px;
}

/* ---------- 2-Column Row ---------- */
.register-card-columns {
  display: flex;
  flex: 1;
}

@keyframes registerCardIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Left Column (Branding) ---------- */
.register-left {
  flex: 1;
  padding: 40px 40px 40px 40px;
  display: flex;
  flex-direction: column;
}

.register-left .register-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-link-blue) !important;
  margin-bottom: 8px;
}

.register-left .register-step-subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-gray-dark);
}

/* ---------- Right Column (Form) ---------- */
.register-right {
  flex: 1;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
}

/* ---------- Step Panels ---------- */
.register-step {
  display: none;
  flex: 1;
  flex-direction: column;

  /* Step transition: fade + slight slide */
  animation: stepFadeIn 0.3s ease-out both;
}

.register-step.active {
  display: flex;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ---------- Step 2.1 "Why We Ask" — full-width in right column ---------- */
.register-step-why {
  gap: 16px;
}

.register-step-why .register-why-copy {
  font-size: 0.92rem;
  color: var(--color-gray-dark);
  line-height: 1.6;
}

.register-step-why .register-why-privacy {
  font-size: 0.85rem;
  color: var(--color-gray);
  margin-top: 8px;
}

.register-step-why .register-why-learn-more {
  font-size: 0.88rem;
  color: var(--color-link-blue);
  text-decoration: none;
  font-weight: 500;
}

.register-step-why .register-why-learn-more:hover {
  text-decoration: underline;
}

/* ---------- Form Elements ---------- */
.register-input-group {
  position: relative;
  margin-bottom: 16px;
}

/* ---------- Password Toggle (eye icon) ---------- */
.register-input-wrapper {
  position: relative;
}

.register-input-wrapper .toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-gray-dark);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  z-index: 2;
  border-radius: 6px;
}

.register-input-wrapper .toggle-password i {
  font-size: 1.25rem;
  line-height: 1;
}

.register-input-wrapper .toggle-password:hover {
  color: var(--color-primary);
  background: var(--color-gray-lightest);
}

.register-input-wrapper .toggle-password:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.register-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.register-label-sm {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-gray);
  margin-bottom: 4px;
}

.register-input-group .form-control,
.register-input-group select {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  border: 1px solid var(--color-gray-light);
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #fff;
  color: var(--color-primary-dark);
}

/* Ensure selects show full text and have consistent height */
.register-input-group select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 46px;
  line-height: 1.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23868686' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.register-input-group .form-control:focus,
.register-input-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(34, 57, 118, 0.18);
  outline: none;
}

/* Shake animation for invalid input */
.register-input-group.shake .form-control,
.register-input-group.shake select {
  animation: shakeInput 0.4s ease-out;
  border-color: var(--color-deficiency-text);
}

@keyframes shakeInput {
  0%, 100% { transform: translateX(0); }
  15%  { transform: translateX(-6px); }
  30%  { transform: translateX(6px); }
  45%  { transform: translateX(-4px); }
  60%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  90%  { transform: translateX(2px); }
}

/* ---------- Birthday Row ---------- */
.register-birthday-row {
  display: flex;
  gap: 10px;
}

.register-birthday-row .register-input-group {
  flex: 1;
}

.register-birthday-row .register-input-group.birthday-month {
  flex: 1.6;
}

/* ---------- Next / Submit Buttons (Right-aligned) ---------- */
.register-btn-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.btn-register-next,
.btn-register-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.btn-register-next:hover,
.btn-register-create:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-register-next:focus-visible,
.btn-register-create:focus-visible {
  outline: 3px solid rgba(34, 57, 118, 0.45);
  outline-offset: 2px;
}

.btn-register-next:active,
.btn-register-create:active {
  transform: translateY(0);
}

.btn-register-next:disabled,
.btn-register-create:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Button loading spinner */
.btn-register-create .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: button-spin 0.6s linear infinite;
}

.btn-register-create.loading .spinner {
  display: inline-block;
}

.btn-register-create.loading .btn-text {
  display: none;
}

@keyframes button-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ---------- Back / Go-back Button ---------- */
.btn-register-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--color-gray-light);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary-dark) !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-register-back:hover {
  background: #eee;
  border-color: var(--color-gray);
}

.btn-register-back:focus-visible {
  outline: 2px solid var(--color-link-blue);
  outline-offset: 2px;
}

/* ---------- "Why We Ask" Link ---------- */
.register-why-link {
  display: inline-block;
  font-size: 0.88rem;
  color: var(--color-link-blue);
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.register-why-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.register-why-link:focus-visible {
  outline: 2px solid var(--color-link-blue);
  outline-offset: 2px;
}

/* ---------- Divider ("or") ---------- */
.register-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--color-gray-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.register-divider::before,
.register-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-light);
}

/* ---------- Google Sign-Up Button ---------- */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  background: #fff;
  border: 1px solid var(--color-gray-light);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-gray-dark);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 12px;
}

.btn-google:hover {
  background: var(--color-gray-lightest);
  border-color: #d1d5db;
  color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.btn-google:focus-visible {
  outline: 3px solid rgba(34, 57, 118, 0.2);
  outline-offset: 2px;
}

.btn-google i {
  font-size: 1.2rem;
}

/* ---------- Facebook Sign-Up Button ---------- */
.btn-facebook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  background: #fff;
  border: 1px solid var(--color-gray-light);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-gray-dark);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 24px;
}

.btn-facebook:hover {
  background: var(--color-gray-lightest);
  border-color: #d1d5db;
  color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.btn-facebook:focus-visible {
  outline: 3px solid rgba(24, 119, 242, 0.2);
  outline-offset: 2px;
}

.btn-facebook i {
  font-size: 1.2rem;
  color: #1877f2 !important;
}

/* ---------- Sign-in Link ---------- */
.register-signin-link {
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-gray-dark);
}

.register-signin-link a {
  color: var(--color-link-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.register-signin-link a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.register-signin-link a:focus-visible {
  outline: 2px solid var(--color-link-blue);
  outline-offset: 2px;
}

/* ---------- Terms Checkbox ---------- */
.register-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.register-terms input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
  margin-top: 2px;
  flex-shrink: 0;
}

.register-terms label {
  font-size: 0.85rem;
  color: var(--color-gray-dark);
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
}

.register-terms label a {
  color: var(--color-link-blue);
  text-decoration: none;
  font-weight: 500;
}

.register-terms label a:hover {
  text-decoration: underline;
}

/* ---------- Validation Error Display ---------- */
.register-input-group .validation-error {
  font-size: 0.8rem;
  color: var(--color-deficiency-text);
  margin-top: 4px;
  display: none;
  animation: shakeInput 0.4s ease-out;
}

.register-input-group .validation-error[style*="display: block"] {
  display: block !important;
}

/* ---------- CountrySelect Container ---------- */
#country-container {
  margin-bottom: 12px;
}

/* ---------- Helper Text ---------- */
.register-helper {
  font-size: 0.8rem;
  color: var(--color-gray);
  margin-top: -8px;
  margin-bottom: 16px;
}

/* ---------- Gender Select ---------- */
/* (select rules are defined above in .register-input-group select) */

/* ---------- Birthday Error ---------- */
#birthday-error.register-birthday-error {
  margin-top: -8px;
  margin-bottom: 12px;
}

/* ---------- Why We Ask Modal ---------- */
.modal-why-we-ask .why-we-ask-required {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-why-we-ask .why-we-ask-optional {
  font-weight: 400;
  color: var(--color-gray-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-why-we-ask .why-we-ask-privacy {
  font-weight: 400;
  color: var(--color-gray);
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-why-we-ask .why-we-ask-learn-more {
  font-size: 0.88rem;
  color: var(--color-link-blue);
  text-decoration: none;
  font-weight: 500;
}

.modal-why-we-ask .why-we-ask-learn-more:hover {
  text-decoration: underline;
}

/* ---------- Footer (Below card, normal flow) ---------- */
/* ---------- Footer (Below card, normal flow) ---------- */
.register-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1154px;
  padding: 16px 20px 24px;
  margin-top: 0;
  font-size: 0.82rem;
}

/* Language switcher (left side) */
.register-lang-switcher .btn-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.register-lang-switcher .btn-lang i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.register-lang-switcher .btn-lang:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  transform: translateY(-1px);
}

.register-lang-switcher .btn-lang:hover i {
  transform: rotate(20deg);
}

.register-lang-switcher .btn-lang:active {
  transform: translateY(0);
}

.register-lang-switcher .btn-lang:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* Footer links (right side) */
.register-footer-links a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease, text-decoration 0.2s ease;
  margin: 0 10px;
}

.register-footer-links a:hover {
  color: var(--color-blue-light) !important;
  text-decoration: underline;
}

.register-footer-links a:focus-visible {
  outline: 2px solid var(--color-blue-light) !important;
  outline-offset: 2px;
}

.register-footer-links span {
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Responsive @576px ---------- */
@media (max-width: 576px) {
  .bg-login {
    background-attachment: scroll;
  }

  .register-container {
    padding: max(16px, env(safe-area-inset-top, 0px)) 12px max(16px, env(safe-area-inset-bottom, 0px));
  }

  .register-card {
    max-width: 100%;
    border-radius: 0;
  }

  .register-logo-header {
    padding: 20px 20px 12px;
  }

  .register-card-columns {
    flex-direction: column;
  }

  .register-left {
    padding: 24px 20px 12px;
    text-align: center;
  }

  .register-right {
    padding: 12px 20px 32px;
  }

  .register-left .register-step-title {
    font-size: 1.35rem;
  }

  .register-left .register-step-subtitle {
    font-size: 0.9rem;
  }

  .register-birthday-row {
    flex-wrap: wrap;
  }

  .register-footer {
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    margin-top: 0;
  }

  .register-footer-links {
    text-align: center;
  }

  .register-btn-row {
    justify-content: flex-end;
  }

  .btn-register-next,
  .btn-register-create {
    min-width: 110px;
    padding: 12px 20px;
  }
}
