/* 
   Hueying Member System - Professional Theme 
   Clean, Modern, Dark-Mode Friendly (Slate/Blue Palette)
*/

:root {
  /* Core Colors */
  --m-bg-main: #f8fafc;       /* Light Slate Background */
  --m-bg-card: #ffffff;       /* White Card */
  --m-text-primary: #0f172a;  /* Slate 900 */
  --m-text-secondary: #64748b;/* Slate 500 */
  --m-primary: #2563eb;       /* Royal Blue */
  --m-primary-hover: #1d4ed8;
  --m-danger: #ef4444;
  --m-success: #22c55e;
  --m-border: #e2e8f0;        /* Slate 200 */
  
  /* Badges */
  --badge-gold: #b45309;      /* Dark Amber for Text */
  --badge-gold-bg: #fef3c7;   /* Light Amber for BG */
  
  /* Spacing & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Dark Mode Support (if parent has dark class or system pref) */
@media (prefers-color-scheme: dark) {
  :root {
    --m-bg-main: #0f172a;
    --m-bg-card: #1e293b;
    --m-text-primary: #f8fafc;
    --m-text-secondary: #94a3b8;
    --m-border: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  }
}

/* Scoped Reset for Member Area */
.member-scope {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--m-text-primary);
  line-height: 1.5;
}

.member-scope * {
  box-sizing: border-box;
}

/* --- Components --- */

/* 1. Navbar Badge (Right Top) */
.user-auth-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 100%;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--m-primary);
  color: white !important;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,0.1);
}

.member-badge:hover {
  background: var(--m-primary-hover);
  transform: translateY(-1px);
}

/* Logged in state styling */
.member-badge.logged-in {
  background: white;
  color: var(--m-text-primary) !important;
  border: 1px solid var(--m-border);
  padding: 4px 12px 4px 4px; /* Less padding left for avatar */
}

.member-badge.logged-in:hover {
  background: var(--m-bg-main);
}

.user-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--m-border);
}

/* Dropdown */
.user-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background-color: var(--m-bg-card);
  min-width: 160px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 8px 0;
  z-index: 1000;
  border: 1px solid var(--m-border);
  margin-top: 8px;
}

.user-dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-item {
  color: var(--m-text-primary);
  padding: 8px 16px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  transition: background 0.1s;
}

.dropdown-item:hover {
  background-color: var(--m-bg-main);
  color: var(--m-primary);
}


/* 2. Auth Container (Login/Register) */
.auth-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--m-bg-main);
}

.auth-card {
  background: var(--m-bg-card);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--m-border);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--m-text-primary);
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--m-text-secondary);
  font-size: 14px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label, label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--m-text-primary);
}

.form-input, input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--m-bg-main);
  border: 1px solid var(--m-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--m-text-primary);
  transition: border-color 0.2s;
}

.form-input:focus, input:focus {
  outline: none;
  border-color: var(--m-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-primary {
  background: var(--m-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--m-primary-hover);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--m-text-secondary);
  border-top: 1px solid var(--m-border);
  padding-top: 20px;
}

.auth-footer a {
  color: var(--m-primary);
  text-decoration: none;
  font-weight: 500;
}

/* 3. Profile Dashboard */
.dashboard-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  min-height: 60vh;
}

.dashboard-sidebar {
  background: var(--m-bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--m-border);
  padding: 20px;
  height: fit-content;
}

.user-mini-profile {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--m-border);
  display: flex;
  flex-direction: column;
  align-items: center; /* Center align everything */
}

/* Avatar Wrapper & Overlay */
.avatar-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--m-bg-main);
}

.user-avatar-lg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.avatar-overlay span {
  color: #fff;
  font-size: 10px;
  font-weight: 500;
}

.avatar-wrapper:hover .avatar-overlay {
  opacity: 1;
}

.user-name-display {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}

.user-role-badge {
  display: inline-block;
  background: var(--badge-gold-bg);
  color: var(--badge-gold);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--m-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  margin-bottom: 4px;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--m-bg-main);
  color: var(--m-primary);
  font-weight: 500;
}

.dashboard-content {
  background: var(--m-bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--m-border);
  padding: 30px;
}

.content-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--m-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.info-item label {
  display: block;
  font-size: 13px;
  color: var(--m-text-secondary);
  margin-bottom: 6px;
}

.info-item div {
  font-size: 16px;
  font-weight: 500;
}

.product-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.p-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: var(--m-bg-main);
  border: 1px solid var(--m-border);
}

.p-badge.active {
  border-color: var(--m-primary);
  color: var(--m-primary);
  background: rgba(37, 99, 235, 0.05);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--m-bg-card);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.2s;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--m-text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

/* --- Registration Specific Styles --- */
.register-card {
  max-width: 600px; /* Wider than standard login card */
}

/* Steps Indicator */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.steps::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--m-border);
  z-index: -1;
}

.step {
  position: relative;
  z-index: 1;
  background: var(--m-bg-card);
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--m-text-secondary);
}

.step.active {
  color: var(--m-primary);
}

.step.active .step-num {
  background: var(--m-primary);
  color: white;
  border-color: var(--m-primary);
}

.step.completed .step-num {
  background: var(--m-success);
  color: white;
  border-color: var(--m-success);
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--m-bg-card);
  border: 2px solid var(--m-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s;
}

.step-text {
  font-size: 12px;
  font-weight: 500;
}

/* Input Group for Verification Code */
.input-group {
  display: flex;
  gap: 12px;
}

.input-group input {
  flex: 1;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--m-border);
  color: var(--m-text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--m-primary);
  color: var(--m-primary);
  background: rgba(37, 99, 235, 0.05);
}

/* Product Selection */
.product-selection {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.product-option {
  position: relative;
  cursor: pointer;
}

.product-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.product-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid var(--m-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
  color: var(--m-text-primary);
}

.product-option input:checked + .product-card {
  border-color: var(--m-primary);
  background: rgba(37, 99, 235, 0.05);
  color: var(--m-primary);
  box-shadow: 0 0 0 1px var(--m-primary);
}

.product-option:hover .product-card {
  border-color: var(--m-primary);
}

/* Step 2 Content */
.step-content-box {
  text-align: center;
  padding: 20px 0;
}

.step-content-box .note {
  color: var(--m-text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}

/* Success Box */
.success-box {
  text-align: center;
  padding: 40px 0;
}

.success-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.action-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 32px;
}

.action-buttons .btn-lg {
  padding: 12px 32px;
  font-size: 16px;
}
