/* ==========================================================================
   Rubikon Club — Account Dashboard Styles
   ========================================================================== */

:root {
  --color-success:     #4CAF50;
  --color-success-dim: rgba(76, 175, 80, .12);
  --color-warning:     #FF6B35;
  --color-warning-dim: rgba(255, 107, 53, .12);
}

/* ---------- Hero Panel ---------- */
.acct-hero {
  padding: 120px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.acct-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,198,0,.06) 0%, transparent 60%);
  pointer-events: none;
}
.acct-hero--premium::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(255,198,0,.12) 0%, transparent 60%);
}
.acct-hero--ambassador::before {
  background: radial-gradient(ellipse at 50% 0%, rgba(255,198,0,.18) 0%, transparent 50%);
}
.acct-hero__inner {
  position: relative;
  z-index: 2;
}
.acct-hero__greeting {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 16px;
}
.acct-hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.acct-hero__status-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-accent);
}
.acct-hero__status-cashback {
  font-size: .8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--color-accent-dim);
  color: var(--color-accent);
}

.acct-hero__balance {
  margin-bottom: 24px;
}
.acct-hero__balance-label {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.acct-hero__balance-number {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}
.acct-hero__balance-currency {
  font-size: .4em;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.acct-hero__mini-progress {
  max-width: 320px;
  margin: 0 auto 32px;
}
.acct-hero__mini-bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.acct-hero__mini-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 4px;
  width: 0%;
  transition: width 1s var(--ease);
}
.acct-hero__mini-label {
  font-size: .8rem;
  color: var(--color-text-dim);
}

.acct-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

@media (min-width: 768px) {
  .acct-hero { padding: 140px 0 64px; }
}

/* ---------- Progress Block ---------- */
.acct-progress {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
}
.acct-progress__levels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.acct-progress__level {
  display: flex;
  align-items: center;
  gap: 12px;
}
.acct-progress__dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.acct-progress__dot--current {
  border: 2px solid var(--color-accent);
  background: var(--color-accent-dim);
  color: var(--color-accent);
}
.acct-progress__dot--next {
  border: 2px dashed var(--color-border);
  color: var(--color-text-muted);
}
.acct-progress__level-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acct-progress__current-name,
.acct-progress__next-name {
  font-size: .9rem;
  font-weight: 600;
}
.acct-progress__next-name {
  color: var(--color-text-muted);
}
.acct-progress__current-pct,
.acct-progress__next-pct {
  font-size: .75rem;
  color: var(--color-text-dim);
}
.acct-progress__arrow {
  color: var(--color-text-dim);
  flex-shrink: 0;
}
.acct-progress__bar {
  height: 10px;
  background: var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.acct-progress__bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 10px;
  width: 0%;
  transition: width 1.2s var(--ease);
}
.acct-progress__bar-fill--hot {
  background: linear-gradient(90deg, var(--color-accent), #FFE066);
  box-shadow: 0 0 16px var(--color-premium-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px var(--color-premium-glow); }
  50% { box-shadow: 0 0 24px rgba(255,198,0,.35); }
}
.acct-progress__label {
  font-size: .85rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 8px;
}
.acct-progress__motivation {
  font-size: .9rem;
  color: var(--color-text-dim);
  text-align: center;
  font-style: italic;
}

@media (min-width: 768px) {
  .acct-progress { padding: 40px 36px; }
}

/* ---------- Bonus Account Block ---------- */
.acct-bonus {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
}
.acct-bonus__label {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.acct-bonus__number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
  margin-bottom: 4px;
}
.acct-bonus__currency {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}
.acct-bonus__alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-warning-dim);
  border: 1px solid rgba(255, 107, 53, .2);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: left;
}
.acct-bonus__alert-icon {
  color: var(--color-warning);
  flex-shrink: 0;
}
.acct-bonus__alert-text {
  font-size: .85rem;
  color: var(--color-warning);
  font-weight: 500;
}
.acct-bonus__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

@media (min-width: 768px) {
  .acct-bonus { padding: 40px 36px; }
}

/* ---------- Use Bonuses Block ---------- */
.acct-use-bonuses {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
}
.acct-use-bonuses__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.acct-use-bonuses__desc {
  font-size: .925rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.acct-use-bonuses__example {
  background: var(--color-accent-dim);
  border: 1px solid rgba(255,198,0,.2);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}
.acct-use-bonuses__example-label {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.acct-use-bonuses__example-calc {
  font-size: 1.1rem;
  font-weight: 600;
}
.acct-use-bonuses__example-calc s {
  color: var(--color-text-dim);
  font-weight: 400;
}
.acct-use-bonuses__example-calc .accent {
  color: var(--color-accent);
}

.acct-use-bonuses__features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.acct-use-bonuses__feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
}
.acct-use-bonuses__feature-icon {
  color: var(--color-accent);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .acct-use-bonuses { padding: 40px 36px; }
}

/* ---------- Level Cards: Active & Reached modifiers ---------- */
.level-card--active {
  background: var(--color-accent-dim);
  border-radius: var(--radius-md);
  padding-left: 16px !important;
  padding-right: 16px !important;
  margin: 4px -16px;
  border: 1px solid rgba(255,198,0,.2);
}
.level-card--active .level-card__dot {
  border-color: var(--color-accent) !important;
  background: var(--color-accent) !important;
  color: var(--color-bg) !important;
  box-shadow: 0 0 20px var(--color-premium-glow);
}
.level-card--reached .level-card__dot::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  bottom: -2px;
  right: -2px;
}
.level-card--reached .level-card__dot {
  position: relative;
}

/* ---------- Achievements Grid ---------- */
.acct-achievements__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.acct-achievement {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  transition: all .3s var(--ease);
  position: relative;
}
.acct-achievement--unlocked {
  border-color: rgba(255,198,0,.2);
}
.acct-achievement--unlocked:hover {
  border-color: rgba(255,198,0,.4);
  transform: translateY(-2px);
}
.acct-achievement--locked {
  opacity: .5;
}
.acct-achievement__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  background: var(--color-accent-dim);
  color: var(--color-accent);
}
.acct-achievement--locked .acct-achievement__icon {
  background: var(--color-bg-card-alt);
  color: var(--color-text-dim);
  filter: grayscale(1);
}
.acct-achievement__name {
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.acct-achievement__bonus {
  font-size: .75rem;
  color: var(--color-accent);
  font-weight: 600;
}
.acct-achievement__status {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--color-success);
}
.acct-achievement--locked .acct-achievement__status {
  color: var(--color-text-dim);
}

@media (min-width: 600px) {
  .acct-achievements__grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ---------- Active Tasks ---------- */
.acct-tasks__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acct-task {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color .2s;
}
.acct-task:hover {
  border-color: rgba(255,198,0,.2);
}
.acct-task__info {
  flex: 1;
  min-width: 0;
}
.acct-task__title {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.acct-task__desc {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.acct-task__deadline {
  font-size: .75rem;
  color: var(--color-text-dim);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.acct-task__right {
  text-align: center;
  flex-shrink: 0;
  min-width: 64px;
}
.acct-task__reward {
  font-size: .9rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.acct-task__counter {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.acct-task__bar {
  height: 4px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
.acct-task__bar-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 4px;
  transition: width .6s var(--ease);
}

@media (min-width: 600px) {
  .acct-tasks__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Bonus History ---------- */
.acct-history__filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.acct-history__filter {
  padding: 8px 18px;
  border-radius: 100px;
  font-size: .85rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all .2s;
}
.acct-history__filter:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}
.acct-history__filter--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-bg);
  font-weight: 600;
}
.acct-history__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.acct-history__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-bg-card);
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.acct-history__item:hover {
  background: var(--color-bg-card-alt);
}
.acct-history__item-date {
  font-size: .8rem;
  color: var(--color-text-dim);
  flex-shrink: 0;
  min-width: 80px;
}
.acct-history__item-reason {
  flex: 1;
  font-size: .875rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-history__item-amount {
  font-size: .9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.acct-history__item-amount--earned {
  color: var(--color-success);
}
.acct-history__item-amount--spent {
  color: var(--color-warning);
}
.acct-history__empty {
  text-align: center;
  color: var(--color-text-dim);
  padding: 32px 0;
  font-size: .9rem;
}

/* ---------- Ambassador Active State ---------- */
.ambassador--active .ambassador__cta-btn {
  background: transparent;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  pointer-events: none;
}

/* ---------- Loading State ---------- */
.acct-state {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 100px;
}
.acct-loading {
  text-align: center;
}
.acct-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}
.acct-loading__text {
  font-size: .95rem;
  color: var(--color-text-muted);
}

/* ---------- Error State ---------- */
.acct-error {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}
.acct-error__icon {
  color: var(--color-warning);
  margin-bottom: 20px;
}
.acct-error__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.acct-error__desc {
  font-size: .9rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ---------- Empty States ---------- */
.acct-achievements__empty,
.acct-tasks__empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-dim);
  font-size: .9rem;
}

/* ---------- Section title (reusable in account) ---------- */
.acct-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.acct-section-subtitle {
  font-size: .9rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ---------- Level Card: Next Level Highlight ---------- */
.level-card--next {
  border-radius: var(--radius-md);
  padding-left: 16px !important;
  padding-right: 16px !important;
  margin: 4px -16px;
  border: 1px dashed rgba(255,198,0,.3);
}
.level-card--next .level-card__dot {
  border-color: rgba(255,198,0,.4) !important;
  border-style: dashed !important;
  color: var(--color-accent) !important;
}

/* ---------- Task Deadline Urgent ---------- */
.acct-task__deadline--urgent {
  color: var(--color-warning) !important;
  font-weight: 600;
}
.acct-task__deadline--urgent svg {
  color: var(--color-warning);
}
.acct-task__reward {
  font-size: 1rem;
}

/* ---------- Referral Block ---------- */
.acct-referral {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
}
.acct-referral__header {
  margin-bottom: 24px;
}
.acct-referral__link-row {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.acct-referral__link-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: .85rem;
  font-family: var(--font-body);
}
.acct-referral__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.acct-referral__stat {
  background: var(--color-bg-card-alt);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.acct-referral__stat-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.acct-referral__stat-label {
  font-size: .8rem;
  color: var(--color-text-muted);
}
.acct-referral__how {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.acct-referral__how-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .875rem;
  color: var(--color-text-muted);
}
.acct-referral__how-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .acct-referral { padding: 40px 36px; }
  .acct-referral__how { flex-direction: row; gap: 24px; }
}

/* ---------- History Type Badges ---------- */
.acct-history__type-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  margin-right: 6px;
  vertical-align: middle;
}
.acct-history__type-badge--referral {
  background: rgba(76, 175, 80, .12);
  color: var(--color-success);
}
.acct-history__type-badge--achievement {
  background: var(--color-accent-dim);
  color: var(--color-accent);
}

/* ---------- Two-column layout for progress+bonus on desktop ---------- */
@media (min-width: 768px) {
  .acct-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}
