/* ============================================
   AMODA — Auth Pages (Login / Register)
   ============================================ */

/* ---- PAGE LAYOUT ---- */
.amoda-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    #0f0f1a 0%,
    #1a1a2e 25%,
    #2d1f3d 50%,
    #4a2a5e 75%,
    #6a3570 100%
  );
}

/* Animated background shapes */
.auth-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: authFloat 20s ease-in-out infinite;
}

.auth-shape-1 {
  width: 500px;
  height: 500px;
  background: var(--amoda-primary);
  top: -15%;
  right: -10%;
  animation-delay: 0s;
}

.auth-shape-2 {
  width: 400px;
  height: 400px;
  background: var(--amoda-gold);
  bottom: -10%;
  left: -5%;
  animation-delay: -7s;
}

.auth-shape-3 {
  width: 300px;
  height: 300px;
  background: #7c3aed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes authFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(15px, 10px) scale(1.02); }
}

/* ---- CONTAINER ---- */
.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  animation: authSlideUp 0.6s ease-out;
}

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

/* ---- BRAND HEADER ---- */
.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

.auth-logo .logo-main {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 8px;
  line-height: 1;
}

.auth-logo .logo-tagline {
  font-family: var(--font-accent);
  font-size: 0.8rem;
  color: var(--amoda-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---- AUTH CARD ---- */
.auth-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* ---- TABS ---- */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 20px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--amoda-primary);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.auth-tab:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.02);
}

.auth-tab.active {
  color: white;
}

.auth-tab.active::after {
  transform: scaleX(1);
}

/* ---- FORM PANELS ---- */
.auth-form-panel {
  display: none;
  padding: 36px 32px 32px;
  animation: authFadeIn 0.35s ease-out;
}

.auth-form-panel.active {
  display: block;
}

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

.auth-form-header {
  margin-bottom: 28px;
}

.auth-form-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: white;
  margin-bottom: 8px;
  font-weight: 600;
}

.auth-form-header p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

/* ---- METHOD TOGGLE ---- */
.auth-method-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.method-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.method-btn:hover {
  color: rgba(255, 255, 255, 0.7);
}

.method-btn.active {
  background: rgba(var(--amoda-primary-rgb), 0.3);
  color: white;
  box-shadow: 0 2px 8px rgba(var(--amoda-primary-rgb), 0.2);
}

/* ---- FORM FIELDS ---- */
.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.auth-field label .required {
  color: var(--amoda-gold);
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forgot-link {
  font-size: 0.8rem;
  color: var(--amoda-gold) !important;
  font-weight: 500;
  transition: color 0.3s ease;
}

.forgot-link:hover {
  color: var(--amoda-gold-light) !important;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper > svg {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.3);
  z-index: 1;
  pointer-events: none;
  transition: color 0.3s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

.input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.input-wrapper input:focus {
  border-color: var(--amoda-primary);
  background: rgba(var(--amoda-primary-rgb), 0.08);
  box-shadow: 0 0 0 3px rgba(var(--amoda-primary-rgb), 0.15);
}

.input-wrapper input:focus ~ svg,
.input-wrapper:focus-within > svg {
  color: var(--amoda-primary-light);
}

/* Phone prefix */
.phone-prefix {
  position: absolute;
  left: 14px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1;
  pointer-events: none;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.phone-prefix + input {
  padding-left: 62px !important;
}

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  transition: color 0.3s ease;
}

.toggle-password:hover {
  color: rgba(255, 255, 255, 0.6);
}

.input-wrapper input[type="password"] + .toggle-password,
.input-wrapper input[type="text"] + .toggle-password {
  /* keep right position */
}

.input-wrapper input {
  padding-right: 44px;
}

/* ---- PASSWORD STRENGTH ---- */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.strength-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  transition: width 0.3s ease, background 0.3s ease;
}

.strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  min-width: 55px;
  text-align: right;
}

/* ---- FORM ROW DOUBLE ---- */
.form-row-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---- AUTH OPTIONS ---- */
.auth-options {
  margin-bottom: 24px;
}

.remember-me,
.terms-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  user-select: none;
}

.remember-me input,
.terms-check input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  position: relative;
}

.checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
  margin-top: -2px;
}

.remember-me input:checked + .checkmark,
.terms-check input:checked + .checkmark {
  background: var(--amoda-primary);
  border-color: var(--amoda-primary);
}

.remember-me input:checked + .checkmark::after,
.terms-check input:checked + .checkmark::after {
  transform: rotate(45deg) scale(1);
}

/* ---- TERMS ---- */
.auth-terms {
  margin-bottom: 24px;
}

.auth-terms a {
  color: var(--amoda-gold) !important;
  font-weight: 500;
}

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

/* ---- AUTO PASSWORD NOTICE ---- */
.auto-password-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(var(--amoda-primary-rgb), 0.1);
  border: 1px solid rgba(var(--amoda-primary-rgb), 0.2);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.auto-password-notice svg {
  flex-shrink: 0;
  color: var(--amoda-primary-light);
}

/* ---- SUBMIT BUTTON ---- */
.auth-submit {
  margin-bottom: 4px;
}

.btn-auth {
  width: 100%;
  justify-content: center;
  padding: 16px 32px;
  font-size: 0.95rem;
  border-radius: 12px;
  gap: 10px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--amoda-primary), var(--amoda-primary-dark));
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(var(--amoda-primary-rgb), 0.3);
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(var(--amoda-primary-rgb), 0.45);
}

.btn-auth::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.6s ease;
}

.btn-auth:hover::before {
  left: 100%;
}

/* ---- SWITCH LINK ---- */
.auth-switch {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 8px;
}

.auth-switch p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  margin: 0;
}

.switch-link {
  background: none;
  border: none;
  color: var(--amoda-gold) !important;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.3s ease;
}

.switch-link:hover {
  color: var(--amoda-gold-light) !important;
  text-decoration: underline;
}

/* ---- TRUST BADGES ---- */
.auth-trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.trust-item svg {
  color: rgba(255, 255, 255, 0.25);
}

/* ---- WOOCOMMERCE NOTICES ---- */
.amoda-auth-page .woocommerce-notices-wrapper {
  margin-bottom: 20px;
}

.amoda-auth-page .woocommerce-error,
.amoda-auth-page .woocommerce-message,
.amoda-auth-page .woocommerce-info {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  list-style: none;
  margin: 0 0 16px;
}

.amoda-auth-page .woocommerce-error {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #f5a0a0;
}

.amoda-auth-page .woocommerce-message {
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(39, 174, 96, 0.3);
  color: #7ee8a8;
}

.amoda-auth-page .woocommerce-info {
  background: rgba(var(--amoda-primary-rgb), 0.15);
  border: 1px solid rgba(var(--amoda-primary-rgb), 0.3);
  color: var(--amoda-primary-light);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 540px) {
  .amoda-auth-page {
    padding: 24px 16px;
    align-items: flex-start;
    padding-top: 40px;
  }

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

  .auth-form-panel {
    padding: 28px 20px 24px;
  }

  .auth-form-header h2 {
    font-size: 1.4rem;
  }

  .form-row-double {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-tabs {
    font-size: 0.85rem;
  }

  .auth-tab {
    padding: 14px 12px;
    gap: 6px;
    font-size: 0.82rem;
  }

  .auth-trust {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

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

  .auth-logo .logo-main {
    font-size: 1.8rem;
    letter-spacing: 6px;
  }
}

/* ---- HIDE DEFAULT HEADER/FOOTER ON AUTH PAGE ---- */
body.amoda-auth-layout .amoda-announcement-bar,
body.amoda-auth-layout .amoda-header,
body.amoda-auth-layout .amoda-footer,
body.amoda-auth-layout .site-main {
  /* Let the template handle full layout */
}

/* Ensure the auth page takes full screen when using theme header/footer */
.woocommerce-account:not(.logged-in) .amoda-auth-page {
  margin: -1px 0;
}
