/* ═══════════════════════════════════════════
   fractureD Ego — Global Styles
   Version: 1.0
═══════════════════════════════════════════ */

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

:root {
  --bg: #1a1a1a;
  --bg-card: #222222;
  --bg-card2: #2a2a2a;
  --border: rgba(255,255,255,0.08);
  --border-pink: rgba(255,182,193,0.3);
  --text: #f5f5f5;
  --text-dim: rgba(245,245,245,0.6);
  --text-dimmer: rgba(245,245,245,0.32);
  --pink: #ffb6c1;
  --pink-dark: #f9909f;
  --pink-bg: rgba(255,182,193,0.1);
  --pink-bg-card: #ffb6c1;
  --black: #111111;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-width: 260px;
  --nav-height: 66px;
}

html, body {
  height: 100%;
  font-family: 'Nunito Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.022) 1px, transparent 0);
  background-size: 32px 32px;
  pointer-events: none; z-index: 0;
}

/* ── Utility ── */
.hidden { display: none !important; }
.fade-in { animation: fadeUp 0.45s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.5; transform:scale(0.82); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Shared Nav ── */
nav.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px; height: var(--nav-height);
  background: rgba(17,17,17,0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 200;
}
.nav-wordmark {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem; color: var(--text); letter-spacing: 0.01em;
  text-decoration: none;
}
.nav-wordmark span { color: var(--pink); font-style: italic; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-user { font-size: 12px; color: var(--text-dim); }

.btn-ghost {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border);
  color: var(--text-dim); font-family: 'Nunito Sans', sans-serif;
  font-size: 12px; font-weight: 600;
  padding: 7px 16px; border-radius: 100px;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }

/* ── Auth card ── */
.auth-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 60px 24px; position: relative; z-index: 2;
  animation: fadeUp 0.55s ease both;
  min-height: calc(100vh - var(--nav-height));
}
.auth-card {
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  padding: 48px 44px; width: 100%; max-width: 420px;
}
.auth-icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 22px; background: var(--pink-bg);
}
.auth-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pink); margin-bottom: 8px; }
.auth-heading { font-family: 'DM Serif Display', serif; font-size: 2.1rem; font-weight: 400; color: var(--text); margin-bottom: 8px; line-height: 1.15; }
.auth-heading em { font-style: italic; color: var(--pink); }
.auth-sub { font-size: 13.5px; color: var(--text-dim); line-height: 1.7; margin-bottom: 32px; }
.auth-footer { font-size: 11px; color: var(--text-dimmer); text-align: center; margin-top: 18px; }
.auth-footer a { color: var(--pink); text-decoration: none; }

/* ── Form fields ── */
.field { margin-bottom: 18px; }
.field-inner {
  background: rgba(255,255,255,0.05); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 20px 14px 8px;
  transition: border-color 0.2s, background 0.2s; position: relative;
}
.field-inner:focus-within { border-color: var(--pink); background: rgba(255,182,193,0.06); }
.field-inner label {
  position: absolute; top: 8px; left: 14px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dimmer); transition: color 0.2s; margin: 0;
}
.field-inner:focus-within label { color: var(--pink); }
.field-inner input {
  width: 100%; background: transparent; border: none; outline: none;
  font-family: 'Nunito Sans', sans-serif; font-size: 14.5px; font-weight: 400;
  color: var(--text); padding: 0; border-radius: 0; letter-spacing: 0.01em;
}
.field-inner input::placeholder { color: var(--text-dimmer); font-size: 13px; }

.form-group { margin-bottom: 16px; }
.form-group > label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dimmer); margin-bottom: 7px;
  position: static;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

textarea {
  width: 100%; background: rgba(255,255,255,0.04); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'Nunito Sans', sans-serif; font-size: 14px;
  padding: 12px 14px; resize: vertical; min-height: 110px; outline: none;
  transition: border-color 0.2s;
}
textarea:focus { border-color: var(--pink); }
textarea::placeholder { color: var(--text-dimmer); }

select {
  width: 100%; background: rgba(255,255,255,0.05); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: 'Nunito Sans', sans-serif; font-size: 14px;
  padding: 12px 14px; outline: none; cursor: pointer;
  transition: border-color 0.2s; appearance: none;
}
select:focus { border-color: var(--pink); }
select option { background: #2a2a2a; color: var(--text); }

/* ── Buttons ── */
.btn-primary {
  width: 100%; border: none; border-radius: 100px;
  font-family: 'Nunito Sans', sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em; padding: 14px 24px; cursor: pointer; margin-top: 10px;
  background: var(--pink-bg-card); color: var(--black);
  box-shadow: 0 2px 12px rgba(255,182,193,0.25);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 4px 20px rgba(255,182,193,0.35); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-submit {
  background: var(--pink-bg-card); color: var(--black);
  border: none; border-radius: 100px;
  font-family: 'Nunito Sans', sans-serif; font-size: 13px; font-weight: 700;
  padding: 13px 28px; cursor: pointer; margin-top: 6px;
  transition: filter 0.2s, transform 0.15s;
  box-shadow: 0 2px 12px rgba(255,182,193,0.25);
}
.btn-submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-submit.full { width: 100%; padding: 15px; }

/* ── Alerts ── */
.error-msg {
  display: none; align-items: center; gap: 7px;
  font-size: 12px; color: #ff7b8a; margin-top: 12px; font-weight: 600;
}
.error-msg.show { display: flex; }

.success-toast {
  display: none; align-items: center; gap: 10px;
  background: rgba(255,182,193,0.1); border: 1px solid var(--border-pink);
  border-radius: var(--radius-md); padding: 14px 18px; margin-top: 16px;
  font-size: 13px; color: var(--pink); font-weight: 600;
}
.success-toast.show { display: flex; animation: fadeUp 0.4s ease both; }

.alert-banner {
  background: rgba(255,120,120,0.08); border: 1px solid rgba(255,120,120,0.25);
  border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 20px;
  font-size: 12.5px; color: #ff9a9a; line-height: 1.6;
}

/* ── Loader ── */
.loader {
  width: 18px; height: 18px; border: 2px solid rgba(255,182,193,0.2);
  border-top-color: var(--pink); border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* ── Sidebar layout ── */
.app-layout { display: flex; min-height: calc(100vh - var(--nav-height)); }

.sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  background: var(--bg-card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 0; position: sticky; top: var(--nav-height);
  height: calc(100vh - var(--nav-height)); overflow-y: auto;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dimmer); padding: 0 20px; margin-bottom: 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 20px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-dim); transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent; text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar-item.active { background: var(--pink-bg); color: var(--pink); border-left-color: var(--pink); }
.sidebar-item .si-icon { font-size: 15px; width: 20px; text-align: center; }
.sidebar-badge {
  margin-left: auto; background: var(--pink); color: var(--black);
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 100px;
}

/* ── Main content area ── */
.main-content { flex: 1; padding: 36px 40px; overflow-y: auto; }

/* ── Dashboard components ── */
.welcome-bar {
  background: linear-gradient(135deg, var(--pink-bg) 0%, rgba(255,182,193,0.04) 100%);
  border: 1px solid var(--border-pink); border-radius: var(--radius-lg);
  padding: 28px 32px; display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.welcome-bar h2 { font-family: 'DM Serif Display', serif; font-size: 1.7rem; font-weight: 400; color: var(--text); }
.welcome-bar h2 em { font-style: italic; color: var(--pink); }
.welcome-bar p { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.welcome-badge { background: var(--pink-bg-card); color: var(--black); font-size: 11px; font-weight: 700; padding: 6px 16px; border-radius: 100px; white-space: nowrap; }

.section-title { font-family: 'DM Serif Display', serif; font-size: 1.4rem; font-weight: 400; color: var(--text); margin-bottom: 5px; }
.section-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px 18px; }
.stat-num { font-family: 'DM Serif Display', serif; font-size: 2rem; color: var(--pink); }
.stat-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; font-weight: 600; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 32px; }
.service-tile {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 18px; cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-decoration: none; display: block;
}
.service-tile:hover { transform: translateY(-3px); border-color: var(--border-pink); box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.st-icon { font-size: 24px; margin-bottom: 10px; }
.st-title { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.st-desc { font-size: 11px; color: var(--text-dim); line-height: 1.6; }

/* ── Request panels ── */
.panel-back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  color: var(--text-dim); background: none; border: 1px solid var(--border);
  border-radius: 100px; padding: 6px 14px; cursor: pointer; margin-bottom: 22px;
  transition: all 0.2s; text-decoration: none;
}
.panel-back:hover { color: var(--pink); border-color: var(--pink); }
.panel-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px 32px; max-width: 580px;
}
.panel-icon { font-size: 30px; margin-bottom: 12px; }
.panel-title { font-family: 'DM Serif Display', serif; font-size: 1.55rem; font-weight: 400; color: var(--text); margin-bottom: 6px; }
.panel-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; line-height: 1.65; }

/* ── History ── */
.history-list { display: grid; gap: 12px; max-width: 700px; }
.history-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
}
.h-icon { font-size: 20px; width: 36px; text-align: center; }
.h-body { flex: 1; }
.h-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.h-meta { font-size: 11px; color: var(--text-dimmer); }
.h-status { font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: 100px; white-space: nowrap; }
.h-status.complete { background: rgba(100,220,160,0.12); color: #64dca0; }
.h-status.pending  { background: var(--pink-bg); color: var(--pink); }
.h-status.review   { background: rgba(255,200,100,0.12); color: #ffc864; }

/* ── Settings ── */
.settings-grid { display: grid; gap: 16px; max-width: 580px; }
.settings-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 22px; }
.settings-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-of-type { border-bottom: none; }
.toggle-label { font-size: 13px; color: var(--text-dim); }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: rgba(255,255,255,0.1); border-radius: 100px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 50%; left: 3px; top: 3px; transition: transform 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--pink); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Wish page ── */
.wish-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 60px 24px; z-index: 2; position: relative;
  animation: fadeUp 0.55s ease both;
}
.wish-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 52px 48px;
  width: 100%; max-width: 580px; box-shadow: var(--shadow-lg);
}
.wish-icon { font-size: 36px; margin-bottom: 16px; }
.wish-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pink); margin-bottom: 10px; }
.wish-title { font-family: 'DM Serif Display', serif; font-size: 2.2rem; font-weight: 400; color: var(--text); margin-bottom: 10px; line-height: 1.1; }
.wish-title em { font-style: italic; color: var(--pink); }
.wish-sub { font-size: 13.5px; color: var(--text-dim); line-height: 1.75; margin-bottom: 28px; }
.wish-divider { height: 1px; background: var(--border); margin: 24px 0; }
.char-count { font-size: 11px; color: var(--text-dimmer); text-align: right; margin-top: 5px; }

/* ── Admin panel ── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dimmer); padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 13px 16px; font-size: 13px; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.04); }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table .name-cell { color: var(--text); font-weight: 600; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.tag.admin { background: rgba(255,182,193,0.15); color: var(--pink); }
.tag.member { background: rgba(255,255,255,0.07); color: var(--text-dim); }
.tag.active { background: rgba(100,220,160,0.12); color: #64dca0; }
.tag.inactive { background: rgba(255,255,255,0.05); color: var(--text-dimmer); }

.table-action {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 100px;
  cursor: pointer; transition: all 0.2s; font-family: 'Nunito Sans', sans-serif;
}
.table-action:hover { border-color: var(--pink); color: var(--pink); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; padding: 12px 0; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-section { display: flex; flex-direction: row; gap: 2px; margin: 0; padding: 0 8px; }
  .sidebar-label { display: none; }
  .sidebar-item { border-left: none; border-radius: 100px; padding: 7px 14px; white-space: nowrap; font-size: 12px; border-bottom: 2px solid transparent; }
  .sidebar-item.active { border-left: none; border-bottom-color: var(--pink); }
  .main-content { padding: 24px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 36px 24px; }
  .wish-card { padding: 36px 24px; }
  nav.topnav { padding: 0 20px; }
}
@media (max-width: 560px) {
  .panel-card { padding: 28px 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
