/* ==========================================================================
   Minashin Central Account System — Modern UI Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --bg: #07070f;
  --bg-deep: #04040a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-solid: #101120;
  --surface-solid-2: #171829;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --text: #eef0ff;
  --text-muted: #9aa1bc;
  --text-faint: #6c7290;

  --accent: #6366f1;          /* indigo   */
  --accent-hover: #818cf8;
  --accent-2: #a855f7;        /* violet   */
  --accent-3: #22d3ee;        /* cyan     */
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 55%, #d946ef 100%);
  --accent-grad-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(168, 85, 247, 0.16));

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --danger: #fb7185;
  --danger-strong: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.12);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono',
    Consolas, 'Courier New', monospace;

  /* Shape & Elevation */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 8px 40px rgba(99, 102, 241, 0.18);
  --glow-soft: 0 4px 30px rgba(99, 102, 241, 0.12);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.22s;

  /* Layout */
  --container: 1120px;
  --nav-h: 68px;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: rgba(99, 102, 241, 0.4);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #262742;
  border-radius: 6px;
  border: 2px solid var(--bg-deep);
}
::-webkit-scrollbar-thumb:hover {
  background: #34365c;
}

a {
  color: var(--accent-hover);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover {
  color: #b0b7ff;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  color: #c4b5fd;
}

img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   3. Background Effects
   -------------------------------------------------------------------------- */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: orb-float 18s ease-in-out infinite alternate;
}

.orb-a {
  width: 520px;
  height: 520px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
}

.orb-b {
  width: 460px;
  height: 460px;
  top: 10%;
  right: -160px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 70%);
  animation-delay: -6s;
}

.orb-c {
  width: 420px;
  height: 420px;
  bottom: -140px;
  left: 30%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 70%);
  animation-delay: -12s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

@keyframes orb-float {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.main-content {
  flex: 1;
  width: 100%;
  padding: 32px 0 64px;
}

/* --------------------------------------------------------------------------
   5. Header / Navbar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  background: rgba(7, 7, 15, 0.72);
  border-bottom: 1px solid var(--border);
}

.navbar {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover {
  color: var(--text);
}

.brand-logo {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 2px 10px rgba(99, 102, 241, 0.5));
  transition: transform 0.3s var(--ease-out);
}
.brand:hover .brand-logo {
  transform: rotate(-8deg) scale(1.06);
}

.brand-logo.small {
  width: 24px;
  height: 24px;
}

.brand-sub {
  color: var(--text-faint);
  font-weight: 500;
  margin-left: 6px;
  font-size: 0.95rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle:hover {
  border-color: var(--border-strong);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.nav-link.active {
  color: var(--text);
  background: var(--accent-grad-soft);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.28);
}

.nav-form {
  margin: 0;
  display: inline-flex;
}

/* --------------------------------------------------------------------------
   6. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: rgba(4, 4, 10, 0.7);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.footer-copy {
  color: var(--text-faint);
  font-size: 0.82rem;
  order: 3;
  width: 100%;
  text-align: center;
  margin-top: 6px;
}

.footer-links {
  display: flex;
  gap: 18px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links a:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn svg {
  flex: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.45);
}

.btn-primary {
  background: var(--accent-grad);
  background-size: 160% 160%;
  background-position: 0% 0%;
  color: #fff;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  background-position: 100% 100%;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(129, 140, 248, 0.4);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface-solid);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-solid-2);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(244, 63, 94, 0.4);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.4);
}
.btn-outline-danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1rem;
  border-radius: 14px;
}
.btn-sm {
  padding: 7px 14px;
  font-size: 0.83rem;
  border-radius: 10px;
}
.btn-block {
  display: flex;
  width: 100%;
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
.form-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-grad);
}

.form-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.form-card-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.form-label .label-req {
  color: var(--danger);
  margin-left: 3px;
}

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

.input-icon {
  position: absolute;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}

.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
.form-input::placeholder {
  color: var(--text-faint);
}
.form-input:hover {
  border-color: var(--border-strong);
}
.form-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.input-wrap .form-input {
  padding-left: 42px;
}
.input-wrap .form-input.has-toggle {
  padding-right: 44px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.toggle-password:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.toggle-password svg {
  width: 18px;
  height: 18px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.form-error {
  font-size: 0.83rem;
  color: var(--danger);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.form-error svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.form-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-footer a {
  font-weight: 600;
}

.auth-layout {
  max-width: 460px;
  margin: 24px auto 0;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}
.auth-header .auth-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-grad);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}
.auth-header .auth-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}
.auth-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   9. Alerts
   -------------------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.alert svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}
.alert-error {
  background: var(--danger-bg);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}
.alert-danger {
  background: var(--danger-bg);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}
.alert-success {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}
.alert-warning {
  background: var(--warning-bg);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

/* --------------------------------------------------------------------------
   10. Page Header (sub pages)
   -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-header h1 .page-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  color: #a5b4fc;
}
.page-header h1 .page-icon svg {
  width: 20px;
  height: 20px;
}
.page-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 6px;
}

/* --------------------------------------------------------------------------
   11. Homepage Hero
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 72px 0 40px;
  animation: fade-up 0.7s var(--ease-out) both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c4b5fd;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 26px;
}
.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(120deg, #818cf8 0%, #c084fc 45%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradient-shift 8s ease-in-out infinite;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  max-width: 620px;
  margin: 0 auto 38px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 44px;
}
.hero-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.83rem;
  font-weight: 500;
}
.hero-stat svg {
  width: 16px;
  height: 16px;
  color: var(--accent-hover);
}
.hero-stat strong {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   12. Feature Grid
   -------------------------------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 52px;
}

.feature-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 140px at var(--mx, 50%) var(--my, 0%), rgba(99, 102, 241, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--glow-soft);
  background: var(--surface-hover);
}
.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  margin-bottom: 18px;
  transition: transform 0.3s var(--ease-out);
}
.feature-card:hover .feature-icon {
  transform: scale(1.08) rotate(-4deg);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.04rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.89rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   13. Info Band
   -------------------------------------------------------------------------- */
.info-band {
  margin-top: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-item .info-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.info-item .info-label svg {
  width: 15px;
  height: 15px;
  color: var(--accent-hover);
}
.info-item .info-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}
.info-item .info-value code {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   14. Dashboard / Profile
   -------------------------------------------------------------------------- */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 26px;
  animation: fade-up 0.6s var(--ease-out) both;
}

.profile-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 34px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-grad);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: var(--accent-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
  flex: none;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar.avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 2.2rem;
  border-radius: 26px;
}

.profile-title h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.profile-title .profile-username {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-title .profile-username svg {
  width: 14px;
  height: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
.badge-accent {
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c4b5fd;
}

.profile-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.info-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.info-cell .info-cell-label {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}
.info-cell .info-cell-value {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-all;
}
.info-cell .info-cell-value.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.quick-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  transition: transform 0.22s var(--ease-out), border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease), background 0.22s var(--ease);
}
.quick-card:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: var(--glow-soft);
  background: var(--surface-hover);
}
.quick-card.quick-danger:hover {
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 4px 30px rgba(244, 63, 94, 0.12);
}
.quick-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
}
.quick-card.quick-danger .quick-icon {
  background: var(--danger-bg);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--danger);
}
.quick-icon svg {
  width: 20px;
  height: 20px;
}
.quick-body h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.quick-body p {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   15. Connections
   -------------------------------------------------------------------------- */
.connections-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade-up 0.5s var(--ease-out) both;
}

.connection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease);
}
.connection-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--glow-soft);
  transform: translateY(-2px);
}

.connection-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.connection-icon {
  width: 46px;
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
  font-weight: 800;
  font-size: 1.05rem;
}
.connection-icon svg {
  width: 22px;
  height: 22px;
}

.connection-info h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.connection-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.connection-meta svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   16. Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--accent-grad-soft);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}
.empty-icon svg {
  width: 30px;
  height: 30px;
}
.empty-state h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 420px;
  margin: 0 auto 22px;
}

/* --------------------------------------------------------------------------
   17. OAuth Consent
   -------------------------------------------------------------------------- */
.consent-layout {
  max-width: 540px;
  margin: 24px auto 0;
  animation: fade-up 0.5s var(--ease-out) both;
}

.consent-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.consent-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-grad);
}

.consent-app-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.consent-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.consent-app-name {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.consent-app-name strong {
  color: var(--text);
  font-weight: 700;
}

.consent-scopes {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 28px;
}
.consent-scopes h3 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.consent-scopes h3 svg {
  width: 15px;
  height: 15px;
  color: var(--accent-hover);
}

.scope-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.scope-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.scope-item svg {
  width: 18px;
  height: 18px;
  color: var(--success);
  flex: none;
  margin-top: 3px;
}
.scope-item .scope-text strong {
  font-weight: 700;
  display: block;
  font-size: 0.92rem;
}
.scope-item .scope-text span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.consent-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.consent-note {
  margin-top: 18px;
  color: var(--text-faint);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   18. Error Page
   -------------------------------------------------------------------------- */
.error-layout {
  max-width: 520px;
  margin: 40px auto 0;
  text-align: center;
  animation: fade-up 0.5s var(--ease-out) both;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.error-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: var(--danger-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--danger);
}
.error-icon svg {
  width: 34px;
  height: 34px;
}

.error-layout h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.error-layout .error-message {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 30px;
}
.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   19. Animations
   -------------------------------------------------------------------------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.08); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.shake {
  animation: shake 0.4s var(--ease);
}

/* Stagger helper */
.stagger > * {
  animation: fade-up 0.6s var(--ease-out) both;
}
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.12s; }
.stagger > *:nth-child(3) { animation-delay: 0.19s; }
.stagger > *:nth-child(4) { animation-delay: 0.26s; }
.stagger > *:nth-child(5) { animation-delay: 0.33s; }
.stagger > *:nth-child(6) { animation-delay: 0.4s; }

/* --------------------------------------------------------------------------
   20. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(10, 10, 20, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px 18px;
    display: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }
  .nav-menu.open {
    display: flex;
    animation: fade-up 0.3s var(--ease-out) both;
  }
  .nav-link {
    padding: 12px 14px;
  }
  .nav-menu .btn {
    margin-top: 6px;
  }
  .nav-form {
    display: flex;
  }
  .nav-form .btn {
    width: 100%;
  }

  .form-card {
    padding: 28px 22px;
  }
  .consent-card {
    padding: 28px 22px;
  }
  .profile-card {
    padding: 26px 22px;
  }
  .profile-head {
    justify-content: center;
    text-align: center;
  }
  .footer-inner {
    justify-content: center;
  }
  .footer-copy {
    order: 2;
  }
  .footer-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .hero {
    padding-top: 52px;
  }
  .hero-stats {
    flex-direction: column;
    align-items: center;
  }
  .info-band {
    padding: 24px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
