@font-face {
  font-family: "Lato";
  src: url("../assets/fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("../assets/fonts/Lato-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("../assets/fonts/Lato-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #0d4cd3;
  --blue-dark: #063fbd;
  --blue-soft: #edf4ff;
  --text: #0b1f33;
  --muted: #66758a;
  --line: #dce6f4;
  --bg: #f5f7fb;
  --white: #fff;
  --green: #12805c;
  --green-soft: #eaf8f2;
  --red: #c62828;
  --red-soft: #fff1f1;
  --amber: #9b6500;
  --amber-soft: #fff6df;
  --page-max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Lato", Arial, "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

#app { flex: 1 0 auto; }

.topbar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid #eef2f7;
  flex: 0 0 auto;
}

.topbar__inner {
  max-width: var(--page-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  height: 40px;
  font-size: 23px;
  line-height: 40px;
  font-weight: 900;
}

.brand span { display: inline-block; line-height: 1; }
.brand__gos { color: #0b74d1; }
.brand__ai { color: #ee2b47; }

.role-switch { position: relative; }

.org-button,
.login-button,
.logout-button {
  border: 0;
  border-radius: 14px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.org-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 26px 0 0;
  background: transparent;
}

.org-button::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-55%) rotate(45deg);
}

.role-menu {
  position: absolute;
  z-index: 110;
  top: calc(100% + 6px);
  left: -12px;
  width: 230px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 38, 71, .14);
}

.role-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
}

.role-menu a:hover,
.role-menu a[aria-current="page"] {
  color: var(--blue);
  background: var(--blue-soft);
}

.role-menu a[hidden] { display: none; }

.login-button,
.logout-button {
  padding: 12px 18px;
  background: var(--blue-soft);
}

.login-button:hover,
.logout-button:hover { background: #e3edff; }


.auth-area {
  display: flex;
  align-items: center;
  min-width: 124px;
  justify-content: flex-end;
  margin-left: auto;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 400;
}

.user-menu span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  margin-top: 26px;
  background: #edf3f8;
  border-top: 1px solid #dfe7ef;
  flex: 0 0 auto;
}

.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 34px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 26px 34px;
}

.site-footer a {
  color: #5f6c79;
  font-size: 18px;
  font-weight: 400;
}

.site-footer a:hover {
  color: #27313b;
  text-decoration: underline;
}

.site-footer__authority {
  display: inline-flex;
  align-items: center;
  color: #5f6c79;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

.site-footer__authority img {
  width: 232px;
  max-width: 100%;
  height: auto;
  display: block;
  flex: 0 1 auto;
}

@media (max-width: 720px) {
  .topbar { height: auto; }
  .topbar__inner {
    min-height: 64px;
    padding: 12px 16px;
    gap: 14px;
    flex-wrap: wrap;
  }
  .brand { font-size: 20px; }
  .auth-area { min-width: 0; margin-left: auto; }
  .login-button,
  .logout-button { padding: 12px 16px; font-size: 16px; }
  .user-menu span { max-width: 130px; }
  .site-footer__inner {
    padding-left: 16px;
    padding-right: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .site-footer__links { flex-direction: column; gap: 14px; }
}
