:root {
  --shell-max-width: 880px;
  --ink: #0b1a33;
  --muted: #475569;
  --line: #d5e3f7;
  --bg: #f6f9ff;
  --card: #ffffff;
  --brand: #0a66c2;
  --brand-strong: #084a91;
  --brand-accent: #1da1f2;
  --brand-soft: #e4efff;
  --success: #0f9d58;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 10px 24px rgba(10, 102, 194, 0.08);
  --shadow-md: 0 24px 48px rgba(12, 43, 94, 0.18);
  --page-bg: radial-gradient(1400px circle at -10% -10%, rgba(10, 102, 194, 0.18), transparent 55%),
    radial-gradient(1200px circle at 110% 0%, rgba(29, 161, 242, 0.18), transparent 55%),
    linear-gradient(180deg, #f0f6ff 0%, #ffffff 38%, #f4f8ff 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  position: relative;
  overflow-x: hidden;
}

.app-navbar {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: var(--shell-max-width, 880px);
  margin: 24px auto 12px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  border: 1px solid rgba(10, 102, 194, 0.12);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.app-navbar__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}

.app-navbar__logo img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 160px;
  border-radius: 12px;
  object-fit: contain;
}

.app-navbar__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.app-navbar__nav .back-to-workspace {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(10, 102, 194, 0.18);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(10, 102, 194, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-navbar__nav .back-to-workspace:hover,
.app-navbar__nav .back-to-workspace:focus-visible {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 30px rgba(10, 102, 194, 0.18);
  transform: translateY(-1px);
  outline: none;
}

.app-navbar__nav .back-to-workspace:focus-visible {
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.2);
}

.app-navbar__link {
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.app-navbar__link:hover,
.app-navbar__link:focus-visible {
  color: var(--brand-strong);
  outline: none;
}

@media (max-width: 640px) {
  .app-navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 12px;
    gap: 14px;
  }

  .app-navbar__nav {
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    padding-bottom: 4px;
  }

  .app-navbar__nav .back-to-workspace {
    width: 100%;
    justify-content: center;
  }
}

body::before,
body::after {
  content: '';
  position: fixed;
  width: clamp(380px, 36vw, 520px);
  height: clamp(380px, 36vw, 520px);
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(13, 110, 253, 0.18), rgba(13, 110, 253, 0));
  filter: blur(0px);
  opacity: 0.6;
  z-index: -2;
  pointer-events: none;
  animation: float-doodle 22s ease-in-out infinite;
}

body::before {
  top: -12vh;
  left: -18vw;
}

body::after {
  bottom: -16vh;
  right: -12vw;
  animation-delay: -8s;
  background: radial-gradient(circle at center, rgba(29, 161, 242, 0.16), rgba(29, 161, 242, 0));
}

@keyframes float-doodle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  40% {
    transform: translate3d(12px, -18px, 0) scale(1.04);
  }
  70% {
    transform: translate3d(-10px, 16px, 0) scale(0.98);
  }
}

main,
.page-shell,
.wrap,
.shell {
  position: relative;
  z-index: 1;
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-strong);
}

.btn,
button.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 18px;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-accent));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(10, 102, 194, 0.22);
}

.btn.secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid rgba(10, 102, 194, 0.22);
  box-shadow: none;
}

.btn.secondary:hover {
  background: rgba(10, 102, 194, 0.08);
}

.btn.subtle {
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-strong);
  border: 1px solid rgba(10, 102, 194, 0.12);
}

.input,
input,
textarea,
select {
  font-family: inherit;
}

.input-control,
input[type='text'],
input[type='email'],
input[type='password'],
input[type='tel'],
input[type='date'],
input[type='number'],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(10, 102, 194, 0.18);
  background: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.45;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.15);
}

.surface-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  border: 1px solid rgba(10, 102, 194, 0.12);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.glass-panel {
  background: rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  border: 1px solid rgba(10, 102, 194, 0.14);
  box-shadow: 0 12px 36px rgba(10, 102, 194, 0.12);
  backdrop-filter: blur(14px);
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(10, 102, 194, 0.12);
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 12px;
}

.tablet-card {
  background: rgba(255, 255, 255, 0.86);
  border-radius: 20px;
  border: 1px solid rgba(13, 110, 253, 0.14);
  box-shadow: var(--shadow-sm);
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
  pointer-events: none;
}

.toast-message {
  min-width: 260px;
  max-width: 360px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(10, 102, 194, 0.15);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}

.toast-message.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-message[data-variant='success'] {
  border-color: rgba(15, 157, 88, 0.35);
  box-shadow: 0 18px 36px rgba(15, 157, 88, 0.18);
}

.toast-message[data-variant='danger'] {
  border-color: rgba(220, 38, 38, 0.35);
  box-shadow: 0 18px 36px rgba(220, 38, 38, 0.18);
}

.toast-message[data-variant='warning'] {
  border-color: rgba(217, 119, 6, 0.32);
  box-shadow: 0 18px 36px rgba(217, 119, 6, 0.16);
}

.toast-message__icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.toast-message__body {
  flex: 1;
}

.toast-message__close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  margin-left: 6px;
}

.toast-message__close:hover {
  opacity: 1;
}

.toast-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(10, 102, 194, 0.25);
  border-top-color: var(--brand);
  animation: toast-spin 0.9s linear infinite;
  flex-shrink: 0;
  margin-top: 2px;
}

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

@media (max-width: 720px) {
  .toast-container {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 24px;
    transform: translateX(-50%);
    align-items: center;
  }
  .toast-message {
    min-width: min(320px, 92vw);
    max-width: min(320px, 92vw);
  }
}

@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;
  }
}
