/* ===== Modern Membership Modal - Glassmorphism Design ===== */

.membership-modal {
  position: fixed;
  inset: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  backdrop-filter: blur(12px);
  z-index: 2100;
  overflow-y: auto;
  animation: fadeInBackdrop 0.4s ease-out;
}

@keyframes fadeInBackdrop {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(12px);
  }
}

.membership-modal.hidden {
  display: none !important;
}

.mr-card {
  width: 100%;
  max-width: 900px;
  max-height: 84vh;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3),
    0 10px 40px rgba(102, 126, 234, 0.2);
  animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

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

.mr-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(102, 126, 234, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}
.mr-card::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(118, 75, 162, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Aside Panel */
.mr-aside {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 2;
  color: #fff;
  overflow-y: auto;
}
.mr-aside-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  color: #fff;
}
.mr-aside-description {
  font-size: 13px;
  line-height: 1.7;
  color: #fff;
  margin: 0;
  font-weight: 500;
}
.mr-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mr-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.mr-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}
.mr-step-text {
  font-size: 13px;
  line-height: 1.7;
  color: #fff;
  font-weight: 500;
}
.mr-step-text strong {
  font-weight: 700;
}

/* Content Area */
.mr-content {
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  min-height: 0;
}
.mr-content-header {
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mr-content-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
  letter-spacing: 0.02em;
}
.mr-close-btn {
  width: 34px;
  height: 34px;
  border: 2px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  color: #1f2937;
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  margin-top: -6px;
}
.mr-close-btn:hover {
  background: #fff;
  border-color: #667eea;
  color: #667eea;
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.mr-form {
  padding: 18px 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  overflow-y: auto;
}
.mr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.mr-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mr-input-group.mr-full {
  grid-column: 1 / -1;
}
.mr-input-group span {
  font-size: 12px;
  font-weight: 800;
  color: #1f2937;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 3px;
}
.mr-required {
  color: #dc2626;
  font-weight: 900;
  font-size: 16px;
}
.mr-input-group input,
.mr-input-group textarea {
  padding: 12px 14px;
  border: 2px solid #cfd6e3;
  border-radius: 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: inherit;
  font-weight: 600;
}
.mr-input-group input::placeholder,
.mr-input-group textarea::placeholder {
  color: #6b7280;
  font-style: normal;
  font-weight: 500;
}
.mr-input-group input:hover,
.mr-input-group textarea:hover {
  border-color: #7b8fe3;
  background: #f5f7fb;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.12);
}
.mr-input-group input:focus,
.mr-input-group textarea:focus {
  border-color: #5d6fd3;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(102, 126, 234, 0.16),
    0 12px 28px rgba(102, 126, 234, 0.22);
  transform: translateY(-1px);
}
.mr-input-group textarea {
  resize: vertical;
  min-height: 36px;
  max-height: 72px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Footer */
.mr-footer {
  padding: 16px 22px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  backdrop-filter: blur(10px);
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.mr-btn {
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mr-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.35);
}
.mr-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(102, 126, 234, 0.5);
}
.mr-btn-secondary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.25);
  opacity: 0.9;
}
.mr-btn-secondary:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.35);
}
.mr-btn-ghost {
  background: #fff;
  color: #667eea;
  border: 2px solid #667eea;
}
.mr-btn-ghost:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.08),
    rgba(118, 75, 162, 0.05)
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

/* Status / My Requests modal tweaks */
.mr-card-status {
  max-width: 560px;
  grid-template-columns: 1fr;
  max-height: 80vh;
}
.mr-status-form {
  padding: 18px 22px 12px;
  gap: 12px;
}
.mr-status-footer {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
}
.mr-status-result {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  min-height: 48px;
  max-height: 220px;
  overflow: auto;
  font-size: 13px;
}
.mr-status-result table {
  width: 100%;
}
.mr-status-result th {
  text-align: left;
  font-size: 11px;
  color: #6b7280;
  padding-bottom: 6px;
}
.mr-status-result td {
  font-size: 12px;
  padding: 6px 4px;
  color: #111827;
}

.mr-status-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.mr-status-row .mr-input-group input {
  padding: 10px 12px;
}
.mr-status-btn {
  @apply mr-btn mr-btn-secondary;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 10px;
  min-width: unset;
  width: auto;
  height: auto;
  align-self: center;
  display: inline-flex;
  justify-content: center;
}

@media (max-width: 650px) {
  .mr-status-row {
    grid-template-columns: 1fr;
  }
  .mr-status-btn {
    width: 100%;
    justify-content: center;
  }
}

.mr-status-error {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.12),
    rgba(248, 113, 113, 0.18)
  );
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #991b1b;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.12);
}
.mr-status-error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}
.mr-status-error.hidden {
  display: none;
}

/* Error banner */
.mr-error {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.12),
    rgba(248, 113, 113, 0.18)
  );
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #991b1b;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.12);
}
.mr-error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}
.mr-error.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .mr-card {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
  }
  .mr-content {
    order: 1;
  }
  .mr-aside {
    order: 2;
    padding: 24px 20px;
    gap: 18px;
  }
  .mr-aside-title {
    font-size: 22px;
  }
  .mr-form {
    padding: 20px;
  }
  .mr-row {
    gap: 12px;
  }
}
@media (max-width: 650px) {
  .membership-modal {
    padding: 12px;
  }
  .mr-card {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }
  .mr-aside {
    padding: 24px;
    gap: 16px;
  }
  .mr-aside-title {
    font-size: 20px;
  }
  .mr-aside-description {
    font-size: 13px;
  }
  .mr-steps {
    gap: 16px;
  }
  .mr-form {
    padding: 20px;
    gap: 16px;
  }
  .mr-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .mr-footer {
    padding: 16px;
    flex-direction: column;
  }
  .mr-btn {
    width: 100%;
    justify-content: center;
  }
  .mr-input-group input,
  .mr-input-group textarea {
    font-size: 16px;
    padding: 12px 14px;
  }
}
@media (max-width: 480px) {
  .mr-card::before,
  .mr-card::after {
    display: none;
  }
  .mr-aside {
    padding: 20px;
  }
  .mr-aside-title {
    font-size: 18px;
  }
  .mr-form {
    padding: 16px;
  }
  .mr-footer {
    padding: 12px;
    gap: 8px;
  }
  .mr-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
}
