/* =========================================================
   MELATI MEMBERSHIP - Public Registration & Member Area
   Scoped classes only, so existing public pages stay intact.
   ========================================================= */

:root {
  --melati-yellow: #ffc300;
  --melati-yellow-dark: #e8b400;
  --melati-dark: #1a1729;
  --melati-text: #625f71;
  --melati-border: #e8e7ec;
  --melati-surface: #ffffff;
  --melati-surface-soft: #faf9f6;
  --melati-success: #18864b;
  --melati-warning: #9b6900;
  --melati-danger: #b42318;
}

/* Header CTA */
.melati-header-actions .close-form {
  justify-content: flex-end;
  width: 100%;
}

.wpo-site-header .header-right .close-form .melati-register-cta {
  white-space: nowrap;
  padding: 11px 18px;
  font-size: 14px;
}

.wpo-site-header .header-right .close-form .login {
  white-space: nowrap;
  margin-right: 12px;
}

.melati-mobile-auth > a {
  font-weight: 700 !important;
}

/* Shared */
.membership-page,
.member-shell {
  color: var(--melati-dark);
  background: var(--melati-surface-soft);
}

.membership-page * {
  box-sizing: border-box;
}

.membership-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.membership-card {
  background: var(--melati-surface);
  border: 1px solid var(--melati-border);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(26, 23, 41, 0.08);
}

.membership-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 195, 0, 0.16);
  color: #765b00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.membership-title {
  color: var(--melati-dark);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  font-weight: 800;
  margin: 18px 0 16px;
}

.membership-subtitle {
  color: var(--melati-text);
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}

.membership-field {
  margin-bottom: 18px;
}

.membership-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--melati-dark);
  font-size: 14px;
  font-weight: 700;
}

.membership-field input,
.membership-field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #d8d6dd;
  border-radius: 12px;
  background: #fff;
  color: var(--melati-dark);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.membership-field input:focus,
.membership-field select:focus {
  border-color: var(--melati-yellow-dark);
  box-shadow: 0 0 0 4px rgba(255, 195, 0, 0.15);
}

.membership-field small {
  display: block;
  color: #85818e;
  margin-top: 6px;
  font-size: 12px;
}

.membership-password-wrap {
  position: relative;
}

.membership-password-wrap input {
  padding-right: 50px;
}

.membership-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #787481;
  cursor: pointer;
}

.membership-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--melati-yellow);
  color: var(--melati-dark);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.membership-btn:hover {
  color: var(--melati-dark);
  background: var(--melati-yellow-dark);
  transform: translateY(-1px);
}

.membership-btn-secondary {
  background: #fff;
  border: 1px solid #d8d6dd;
}

.membership-btn-secondary:hover {
  background: #f7f6f8;
}

.membership-btn-full {
  width: 100%;
}

.membership-alert {
  display: none;
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.membership-alert.is-visible {
  display: block;
}

.membership-alert-success {
  color: #12663a;
  background: #eaf8f0;
  border: 1px solid #c6ecd7;
}

.membership-alert-error {
  color: #8f1c13;
  background: #fff0ee;
  border: 1px solid #ffd2cd;
}

/* Registration / Login */
.membership-auth {
  padding: 72px 0 90px;
  background:
    radial-gradient(circle at 8% 12%, rgba(255,195,0,.14), transparent 30%),
    radial-gradient(circle at 88% 85%, rgba(249,64,108,.08), transparent 28%),
    var(--melati-surface-soft);
}

.membership-auth-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 42px;
  align-items: center;
}

.membership-value-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.membership-value-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #4f4b58;
  font-size: 14px;
  line-height: 1.55;
}

.membership-value-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eff8f2;
  color: var(--melati-success);
  font-size: 12px;
}

.membership-form-card {
  padding: 34px;
}

.membership-form-card h2 {
  margin: 0 0 8px;
  color: var(--melati-dark);
  font-size: 26px;
  font-weight: 800;
}

.membership-form-card > p {
  color: #7a7682;
  font-size: 14px;
  margin-bottom: 26px;
}

.membership-phone-group {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
}

.membership-phone-prefix {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8d6dd;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #f7f6f8;
  color: #686471;
  font-size: 14px;
  font-weight: 700;
}

.membership-phone-group input {
  border-radius: 0 12px 12px 0;
}

.membership-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 20px;
  color: #6f6a78;
  font-size: 12px;
  line-height: 1.5;
}

.membership-check input[type="checkbox"] {
  display: block;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--melati-yellow-dark);
}

.membership-check label {
  padding: 0 !important;
  margin: 0;
}

.membership-check label:before {
  display: none !important;
}

.membership-form-footer {
  margin: 20px 0 0;
  color: #77727e;
  text-align: center;
  font-size: 13px;
}

.membership-form-footer a {
  color: #8a6800;
  font-weight: 800;
}

.membership-login-panel {
  max-width: 560px;
  margin: 0 auto;
}

.membership-status-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
}

.membership-status-icon {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: rgba(255, 195, 0, .2);
  color: #806100;
  font-size: 30px;
}

/* Member header */
.member-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--melati-border);
  backdrop-filter: blur(12px);
}

.member-topbar-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 auto;
}

.member-brand img {
  width: 116px;
  height: auto;
}

.member-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.member-nav a,
.member-nav button {
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #625f71;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.member-nav a:hover,
.member-nav button:hover,
.member-nav a.active {
  background: rgba(255,195,0,.16);
  color: var(--melati-dark);
}

.member-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--melati-dark);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.member-shell {
  min-height: calc(100vh - 72px);
  padding: 34px 0 70px;
}

.member-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.member-onboarding {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 15px 18px;
  border: 1px solid #f1dda1;
  border-radius: 14px;
  background: #fff8dc;
  color: #735817;
  font-size: 13px;
}

.member-onboarding.is-visible {
  display: flex;
}

.member-onboarding a {
  color: #735817;
  font-weight: 800;
  white-space: nowrap;
}

.member-welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--melati-border);
  border-radius: 22px;
  background: #fff;
}

.member-status {
  display: inline-flex;
  padding: 6px 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #eaf8f0;
  color: var(--melati-success);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.member-welcome h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  color: var(--melati-dark);
  font-weight: 800;
}

.member-welcome p {
  margin: 0;
  color: #74707c;
  font-size: 14px;
}

.member-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.member-card {
  min-height: 195px;
  padding: 24px;
  border: 1px solid var(--melati-border);
  border-radius: 18px;
  background: #fff;
}

.member-card-label {
  margin: 0 0 16px;
  color: #96919c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.member-card h3 {
  margin: 0 0 6px;
  color: var(--melati-dark);
  font-size: 20px;
  font-weight: 800;
}

.member-card p {
  color: #77727e;
  font-size: 13px;
  line-height: 1.55;
}

.member-card a {
  color: #8a6800;
  font-size: 13px;
  font-weight: 800;
}

.member-progress {
  width: 100%;
  height: 8px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #efedf1;
}

.member-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--melati-yellow);
}

.member-profile-card {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px;
}

.member-profile-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.member-profile-heading h1 {
  margin: 0 0 7px;
  font-size: 30px;
  font-weight: 800;
}

.member-profile-heading p {
  margin: 0;
  color: #77727e;
  font-size: 14px;
}

.member-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.member-readonly {
  background: #f6f5f7 !important;
  color: #817d87 !important;
}

@media (max-width: 1199px) {
  .wpo-site-header .header-right .close-form .melati-register-cta {
    padding: 9px 12px;
    font-size: 12px;
  }
}

@media (max-width: 991px) {
  .membership-auth {
    padding-top: 50px;
  }

  .membership-auth-grid {
    grid-template-columns: 1fr;
  }

  .membership-auth-copy {
    max-width: 720px;
  }

  .member-grid {
    grid-template-columns: 1fr;
  }

  .member-topbar-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .member-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .membership-form-card,
  .membership-status-card,
  .member-profile-card,
  .member-welcome,
  .member-card {
    padding: 22px;
    border-radius: 16px;
  }

  .membership-title {
    font-size: 34px;
  }

  .member-welcome,
  .member-profile-heading,
  .member-onboarding {
    align-items: flex-start;
    flex-direction: column;
  }

  .member-form-grid {
    grid-template-columns: 1fr;
  }

  .member-nav a,
  .member-nav button {
    white-space: nowrap;
  }
}