/* ═══════════════════════════════════════════════════
   CoCo — main.css  (Apple-curved · DM Sans · Sleek)
   Global design tokens, reset, shared utilities
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* ── Backgrounds ── */
  --c-bg:          #09090f;
  --c-bg-2:        #0f0f1a;
  --c-bg-3:        #131320;
  --c-panel:       #16162a;
  --c-panel-2:     #1c1c32;
  --c-hover:       rgba(255,255,255,0.05);
  --c-active:      rgba(108,99,255,0.15);
  --c-border:      rgba(255,255,255,0.07);
  --c-border-2:    rgba(255,255,255,0.12);

  /* ── Brand / Accent ── */
  --c-accent:      #7c6fff;
  --c-accent-2:    #9d95ff;
  --c-accent-dark: #5b52e0;
  --c-accent-glow: rgba(124,111,255,0.3);
  --c-accent-soft: rgba(124,111,255,0.12);

  /* ── Gradients ── */
  --grad-brand:    linear-gradient(135deg,#a78bfa 0%,#7c6fff 40%,#4f46e5 100%);
  --grad-btn:      linear-gradient(135deg,#9d7dff,#6c63ff,#4f6ef7);
  --grad-btn-h:    linear-gradient(135deg,#b09aff,#8178ff,#667bff);
  --grad-card:     linear-gradient(145deg,rgba(255,255,255,0.06),rgba(255,255,255,0.01));
  --grad-auth-bg:  radial-gradient(ellipse 80% 80% at 50% -10%,rgba(124,111,255,0.25),transparent),
                   radial-gradient(ellipse 60% 60% at 90% 90%,rgba(79,70,229,0.2),transparent),
                   #09090f;

  /* ── Status ── */
  --c-online:   #34d399;
  --c-away:     #fbbf24;
  --c-dnd:      #f87171;
  --c-offline:  #6b7280;

  /* ── Text ── */
  --t-1: #f0f0ff;
  --t-2: #a8a8c8;
  --t-3: #6b6b8a;
  --t-4: #44445a;
  --t-link: #9d95ff;

  /* ── Spacing ── */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;  --sp-10: 40px;

  /* ── Apple-style radius ── */
  --r-xs:   8px;
  --r-sm:   12px;
  --r-md:   16px;
  --r-lg:   22px;
  --r-xl:   28px;
  --r-2xl:  36px;
  --r-full: 9999px;

  /* ── Shadows ── */
  --sh-xs:   0 1px 4px rgba(0,0,0,0.4);
  --sh-sm:   0 2px 10px rgba(0,0,0,0.5);
  --sh-md:   0 6px 24px rgba(0,0,0,0.55);
  --sh-lg:   0 12px 48px rgba(0,0,0,0.65);
  --sh-xl:   0 24px 80px rgba(0,0,0,0.75);
  --sh-accent: 0 6px 28px rgba(124,111,255,0.45);
  --sh-btn:    0 4px 18px rgba(108,99,255,0.5);

  /* ── Transitions ── */
  --tr-1: 0.10s cubic-bezier(0.4,0,0.2,1);
  --tr-2: 0.20s cubic-bezier(0.4,0,0.2,1);
  --tr-3: 0.35s cubic-bezier(0.4,0,0.2,1);
  --tr-spring: 0.4s cubic-bezier(0.175,0.885,0.32,1.275);

  /* ── Layout ── */
  --rail-w:    70px;
  --sidebar-w: 248px;
  --members-w: 236px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--c-bg);
  color: var(--t-1);
  line-height: 1.55;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

a { color: var(--t-link); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Selection ── */
::selection { background: rgba(124,111,255,0.35); color: #fff; }

/* ──────────────────────────────────────
   Shared UI Components
────────────────────────────────────── */

/* Primary Button */
.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--grad-btn);
  color: #fff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: all var(--tr-2);
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-btn);
}
.primary-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.primary-btn:hover {
  background: var(--grad-btn-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,99,255,0.6);
}
.primary-btn:active { transform: translateY(0); box-shadow: var(--sh-btn); }
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Secondary / Ghost Button */
.ghost-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 13px 20px;
  background: var(--c-hover);
  color: var(--t-2);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 1.5px solid var(--c-border-2);
  cursor: pointer;
  transition: all var(--tr-2);
}
.ghost-btn:hover { background: rgba(255,255,255,0.08); color: var(--t-1); }

/* Input Group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}
.input-group label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-2);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap input,
.input-wrap textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--c-border-2);
  border-radius: var(--r-sm);
  color: var(--t-1);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: border-color var(--tr-1), box-shadow var(--tr-1), background var(--tr-1);
  outline: none;
  -webkit-appearance: none;
}
.input-wrap input:focus,
.input-wrap textarea:focus {
  border-color: var(--c-accent);
  background: rgba(124,111,255,0.06);
  box-shadow: 0 0 0 4px var(--c-accent-glow);
}
.input-wrap input::placeholder,
.input-wrap textarea::placeholder { color: var(--t-3); }

.input-icon-l {
  position: absolute; left: 13px;
  color: var(--t-3); pointer-events: none; flex-shrink: 0;
}
.input-wrap:has(.input-icon-l) input { padding-left: 40px; }

.pwd-toggle {
  position: absolute; right: 10px;
  background: none; border: none;
  color: var(--t-3); cursor: pointer;
  padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
  transition: color var(--tr-1);
}
.pwd-toggle:hover { color: var(--t-1); }

/* Error + Hint */
.error-msg {
  color: #ff7070;
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.error-msg:not(:empty)::before { content: '⚠ '; }

.input-hint {
  font-size: 0.72rem;
  color: var(--t-3);
  margin-top: 1px;
}

/* Modal textarea */
.modal-textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--c-border-2);
  border-radius: var(--r-sm);
  color: var(--t-1);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  min-height: 70px;
  transition: border-color var(--tr-1), box-shadow var(--tr-1);
}
.modal-textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px var(--c-accent-glow);
}
.modal-textarea::placeholder { color: var(--t-3); }

/* Avatar utility */
.av {
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}
.av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ── Keyframe Animations ── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; } to { opacity:1; }
}
@keyframes slideDown {
  from { opacity:0; transform:translateY(-8px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes scaleIn {
  from { opacity:0; transform:scale(0.92); }
  to   { opacity:1; transform:scale(1); }
}
@keyframes blobFloat {
  0%,100% { transform:translate(0,0) scale(1); }
  33%     { transform:translate(28px,-18px) scale(1.06); }
  66%     { transform:translate(-16px,12px) scale(0.96); }
}
@keyframes confettiFall {
  0%   { transform:translateY(-20px) rotate(0deg); opacity:1; }
  100% { transform:translateY(110vh) rotate(720deg); opacity:0; }
}
@keyframes dotBounce {
  0%,60%,100% { transform:translateY(0); }
  30%          { transform:translateY(-6px); }
}
@keyframes toastSlide {
  from { transform:translateX(110%); opacity:0; }
  to   { transform:translateX(0); opacity:1; }
}
@keyframes toastOut {
  from { transform:translateX(0); opacity:1; }
  to   { transform:translateX(110%); opacity:0; }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes msgPop {
  from { opacity:0; transform:translateY(6px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
