/* ========================================================
   BELIEVE WEB APP — DESIGN SYSTEM & LUXURY STYLING
   ======================================================== */

:root {
  --bg-gradient: linear-gradient(180deg, #F5F2FA 0%, #EDE6FA 50%, #FDFCFE 100%);
  --navy: #1B2B4B;
  --navy-light: #33447A;
  --purple-dark: #6B48A8;
  --purple-light: #EDE6FA;
  --ink: #232333;
  --ink-soft: #5A5A6C;
  --hairline: #ECE8F2;
  --danger: #B14B4B;
  --danger-bg: #F6E6E6;
  --paper: #FFFFFF;
  --radius-card: 24px;
  --radius-pill: 9999px;
  --success: #5C8A66;
  --success-bg: #EAF2EA;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: #F5F2FA;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
}

.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-gradient);
  z-index: -1;
}

/* AUTH WRAPPER */
.auth-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 200;
}

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

.brand-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  box-shadow: 0 12px 24px rgba(27, 43, 75, 0.25);
}

.brand-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* BELIEVE CARD (GLASSMORPHISM) */
.believe-card {
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 24px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(35, 35, 51, 0.06), 0 2px 6px rgba(35, 35, 51, 0.03);
  border: 1px solid rgba(236, 232, 242, 0.8);
}

.full-ui-card {
  text-align: left;
  margin-bottom: 16px;
}

.full-ui-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}

/* SIDEBAR & APP LAYOUT WRAPPER */
.app-layout-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: #F5F2FA;
}

.sidebar {
  width: 260px;
  background: #FFFFFF;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.sidebar.collapsed {
  width: 72px;
  padding: 20px 10px;
}

.sidebar.collapsed .sidebar-header {
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.sidebar.collapsed .sidebar-brand-name {
  display: none;
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: #FAFAFD;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  white-space: nowrap;
}

.sidebar-menu-item:hover {
  background: #FAFAFD;
  color: var(--navy);
}

.sidebar-menu-item.active {
  background: var(--navy);
  color: #FFFFFF;
}

.sidebar.collapsed .sidebar-label {
  display: none;
}

.sidebar.collapsed .sidebar-menu-item {
  justify-content: center;
  padding: 12px 0;
  width: 100%;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.sidebar.collapsed .sidebar-footer {
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple-light);
  color: var(--purple-dark);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar.collapsed .user-info {
  display: none;
}

.btn-signout-sidebar {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
}

/* APP MAIN CONTENT */
.app-main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 28px;
  max-width: 900px;
}

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

@media(max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-topbar {
    display: flex;
  }
  .app-main-content {
    padding: 16px;
  }
}

/* STATS ROW */
.stats-row {
  display: flex;
  justify-content: space-around;
  padding-top: 12px;
  border-top: 1px dashed var(--hairline);
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-val {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.stat-lbl {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ACTIONS GRID */
.actions-grid-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.action-tile {
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 43, 75, 0.1);
}

.action-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--purple-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.action-tile h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.action-tile p {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* EMPTY PLACEHOLDER BOX */
.empty-placeholder-box {
  padding: 18px;
  background: #FAFAFD;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  text-align: center;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header-row h3 {
  margin-bottom: 0;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.badge-navy {
  background: var(--purple-light);
  color: var(--purple-dark);
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.full-width-btn {
  width: 100%;
}

/* CHAT MESSAGING */
.chat-messages-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  min-height: 140px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: var(--navy);
  color: #FFFFFF;
}

.chat-bubble.received {
  align-self: flex-start;
  background: var(--purple-light);
  color: var(--ink);
}

.chat-bubble .time {
  display: block;
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  outline: none;
  font-family: inherit;
  font-size: 13px;
}

.btn-send-chat {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--navy);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* BILLING UI */
.billing-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.billing-amount {
  font-family: monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}

.due-text {
  font-size: 12px;
  color: var(--ink-soft);
}

.ref-code {
  font-family: monospace;
  font-weight: 700;
  color: var(--navy);
  font-size: 13.5px;
  margin-top: 4px;
}

/* SEGMENTED TOP PILL TOGGLE */
.pill-segmented-control {
  display: flex;
  background: #F3EFFC;
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 16px;
}

.pill-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-item.active {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 700;
}

.pill-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* SUBROLE PILL TOGGLE */
.subrole-segmented-control {
  display: flex;
  background: #FAFAFD;
  border-radius: 14px;
  padding: 3px;
  margin-bottom: 22px;
  border: 1px solid #F0ECF6;
}

.subrole-item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subrole-item.active {
  background: #FFFFFF;
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* FORM STYLING */
.form-header {
  margin-bottom: 20px;
}

.form-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.form-header p {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-top: 2px;
}

.input-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.label-with-help {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.label-with-help label {
  margin-bottom: 0;
}

.btn-help-icon {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: #FAFAFD;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  border-color: var(--purple-dark);
  background: #FFFFFF;
}

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

.input-with-action input {
  padding-right: 44px;
}

.btn-input-action {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

/* CURRICULUM SELECTOR */
.curriculum-grid {
  display: flex;
  gap: 10px;
}

.curriculum-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: #FAFAFD;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.curriculum-btn.active {
  background: var(--purple-light);
  color: var(--purple-dark);
}

/* REMEMBER ME & FORGOT PASSWORD */
.remember-forgot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--navy);
  width: 16px;
  height: 16px;
}

.forgot-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--purple-dark);
  text-decoration: none;
}

/* ERROR BANNER */
.error-banner {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 12px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* SUBMIT BUTTON */
.btn-submit-gradient {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(27, 43, 75, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.btn-submit-gradient:hover {
  transform: translateY(-1px);
}

.btn-submit-gradient:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* SPINNER */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* MODAL DIALOG */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  width: 90%;
  max-width: 680px;
  padding: 32px 36px;
  border-radius: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.modal-body p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.modal-highlight {
  background: #F3EFFC;
  color: var(--purple-dark);
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  margin: 12px 0;
  text-align: center;
  font-size: 13px;
}

.btn-submit-navy {
  width: 100%;
  height: 44px;
  background: var(--navy);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 18px;
}

/* UTILITY CLASSES */
.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* CUSTOM THEME DROPDOWN COMPONENT */
.custom-believe-dropdown {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.custom-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFAFD;
  border: 1px solid #E5E5EA;
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-dropdown-trigger:hover {
  border-color: var(--purple-dark);
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(107, 72, 168, 0.1);
}

.custom-dropdown-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(27, 43, 75, 0.14);
  z-index: 100;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.custom-dropdown-option {
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-dropdown-option:hover {
  background: #F0ECFA;
  color: var(--purple-dark);
  font-weight: 700;
}

.custom-dropdown-option.selected {
  background: var(--navy);
  color: #FFFFFF;
  font-weight: 700;
}

/* ========================================================
   METRICS GRID & METRIC CARDS
   ======================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.metric-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 18px 20px !important;
  background: #FFFFFF !important;
  border-radius: 18px !important;
}

.metric-icon-box {
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.metric-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.metric-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-top: 2px;
}

.metric-subtext {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}
