/* Общая база для портала и почты */

:root {
  --brand: #e2231a;
  --brand-dark: #bb1610;
  --brand-soft: #fff0ef;
  --ink: #15151a;
  --soft-ink: #3a3a44;
  --muted: #70707c;
  --line: #e7e7ee;
  --line-strong: #d8d8e2;
  --bg: #f4f4f7;
  --card: #ffffff;
  --green: #0e9f6e;
  --amber: #d97706;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, 0.04), 0 4px 14px rgba(20, 20, 30, 0.04);
  --shadow-md: 0 12px 40px rgba(20, 20, 40, 0.12);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(226, 35, 26, 0.22);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-outline {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(20, 20, 30, 0.05);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

::selection {
  background: rgba(226, 35, 26, 0.16);
}

/* Скроллбар */

* {
  scrollbar-width: thin;
  scrollbar-color: #c8c8d2 transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: #c8c8d2;
  border-radius: 999px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Модальные окна */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 24, 0.55);
  backdrop-filter: blur(4px);
  animation: fade-in 0.16s ease;
}

.modal-backdrop[hidden] {
  display: none !important;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Тосты */

.toasts {
  position: fixed;
  z-index: 2000;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #1c1c22;
  color: #fff;
  box-shadow: 0 12px 34px rgba(10, 10, 20, 0.28);
  font-size: 14px;
  line-height: 1.45;
  animation: toast-in 0.22s ease;
  pointer-events: auto;
}

.toast.toast-success {
  background: #0e6b4c;
}

.toast.toast-error {
  background: #a81712;
}

.toast-icon {
  margin-top: 1px;
  flex: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 720px) {
  .container {
    width: calc(100% - 32px);
  }

  .toasts {
    right: 16px;
    bottom: 16px;
  }

  .modal-backdrop {
    padding: 12px;
  }
}
