/* ══════════════════════════════════════════════════════════════
   git.specvlvm.com — тема Rounded Tech Minimalism
   Одна геометрия, один акцент, холодный тёмный синий вместо чёрного.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* поверхности */
  --rtm-base:      #0B1020;
  --rtm-surface:   #141A28;
  --rtm-surface-2: #1D2436;
  --rtm-surface-3: #232B40;
  --rtm-line:      #2B3450;
  /* текст */
  --rtm-text:      #DDE2F0;
  --rtm-text-hi:   #FFFFFF;
  --rtm-muted:     #7E88A3;
  --rtm-subtle:    #A9C6F0;
  /* акцент — синий, как марка git */
  --rtm-accent:    #4F7BFF;
  --rtm-accent-2:  #2559E8;
  --rtm-cyan:      #35CFFF;
  --rtm-violet:    #6E5CFF;
  --rtm-good:      #A8DCBB;
  --rtm-warn:      #F2D1A0;
  --rtm-crit:      #F4A9A9;
  /* радиусы одной семьи */
  --rtm-r-sm: 8px;
  --rtm-r-md: 12px;
  --rtm-r-lg: 18px;
}

/* ── подмена палитры Forgejo ─────────────────────────────────── */
:root, [data-theme="forgejo-dark"], .theme-forgejo-dark {
  --color-primary:            var(--rtm-accent);
  --color-primary-contrast:   #FFFFFF;
  --color-primary-dark-1:     #4472F5;
  --color-primary-dark-2:     var(--rtm-accent-2);
  --color-primary-dark-3:     #1F4ECF;
  --color-primary-dark-4:     #1943B6;
  --color-primary-dark-5:     #12358F;
  --color-primary-dark-6:     #0D2868;
  --color-primary-dark-7:     #081B45;
  --color-primary-light-1:    #6A8FFF;
  --color-primary-light-2:    #85A4FF;
  --color-primary-light-3:    #A0B8FF;
  --color-primary-light-4:    #BCCCFF;
  --color-primary-light-5:    #D7E1FF;
  --color-primary-light-6:    #E9EEFF;
  --color-primary-light-7:    #F4F7FF;
  --color-primary-alpha-10:   #4F7BFF1a;
  --color-primary-alpha-20:   #4F7BFF33;
  --color-primary-alpha-30:   #4F7BFF4d;
  --color-primary-alpha-40:   #4F7BFF66;
  --color-primary-alpha-50:   #4F7BFF80;
  --color-primary-alpha-60:   #4F7BFF99;
  --color-primary-alpha-70:   #4F7BFFb3;
  --color-primary-alpha-80:   #4F7BFFcc;
  --color-primary-alpha-90:   #4F7BFFe6;
  --color-primary-hover:      #6A8FFF;
  --color-primary-active:     var(--rtm-accent-2);

  --color-secondary:          var(--rtm-line);
  --color-secondary-dark-1:   #333E5E;
  --color-secondary-dark-2:   #3C486C;
  --color-secondary-light-1:  #232B40;
  --color-secondary-alpha-30: #2B34504d;
  --color-secondary-alpha-40: #2B345066;
  --color-secondary-alpha-50: #2B345080;
  --color-secondary-alpha-60: #2B345099;
  --color-secondary-alpha-70: #2B3450b3;
  --color-secondary-alpha-80: #2B3450cc;
  --color-secondary-alpha-90: #2B3450e6;
  --color-secondary-button:   var(--rtm-surface-2);
  --color-secondary-hover:    var(--rtm-surface-3);
  --color-secondary-bg:       var(--rtm-surface-2);

  /* фон и коробки */
  --color-body:               var(--rtm-base);
  --color-box-header:         var(--rtm-surface);
  --color-box-body:           var(--rtm-surface);
  --color-box-body-highlight: var(--rtm-surface-2);
  --color-card:               var(--rtm-surface);
  --color-menu:               var(--rtm-surface);
  --color-header-wrapper:     var(--rtm-base);
  --color-navbar:             var(--rtm-surface);
  --color-nav-bg:             var(--rtm-surface);
  --color-nav-hover-bg:       var(--rtm-surface-2);
  --color-footer:             var(--rtm-base);
  --color-timeline:           var(--rtm-line);

  /* текст */
  --color-text:               var(--rtm-text);
  --color-text-dark:          var(--rtm-text-hi);
  --color-text-light:         #C2C9DC;
  --color-text-light-1:       #ADB5CC;
  --color-text-light-2:       var(--rtm-muted);
  --color-text-light-3:       #6A7391;
  --color-console-fg:         var(--rtm-text);
  --color-console-bg:         #070B16;

  /* поля ввода и границы */
  --color-input-background:   #0F1526;
  --color-input-border:       var(--rtm-line);
  --color-input-border-hover: #3A456A;
  --color-input-text:         var(--rtm-text);
  --color-border:             var(--rtm-line);
  --color-light-border:       #232B40;
  --color-hover:              var(--rtm-surface-2);
  --color-active:             var(--rtm-surface-3);
  --color-shadow:             #00000066;
  --color-secondary-nav-bg:   var(--rtm-surface);

  /* статусы — приглушённые, не неоновые */
  --color-green:   var(--rtm-good);
  --color-success-text: var(--rtm-good);
  --color-success-bg:   #14251C;
  --color-success-border: #244934;
  --color-red:     var(--rtm-crit);
  --color-error-text:   var(--rtm-crit);
  --color-error-bg:     #2A1618;
  --color-error-border: #56282C;
  --color-yellow:  var(--rtm-warn);
  --color-warning-text: var(--rtm-warn);
  --color-warning-bg:   #2A2416;
  --color-warning-border: #56482A;
  --color-info-text:   var(--rtm-subtle);
  --color-info-bg:     #131F33;
  --color-info-border: #274063;
  --color-purple:  var(--rtm-violet);
  --color-teal:    var(--rtm-cyan);
}

/* ── типографика ─────────────────────────────────────────────── */
body, .ui, input, textarea, select, button {
  font-family: "Inter", "Inter Variable", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, .ui.header, .repo-title, .flex-item-title {
  font-family: "Gilroy", "Inter", system-ui, sans-serif;
  letter-spacing: -0.01em;
}
code, pre, .file-view, .monospace {
  font-family: "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, monospace;
}

/* ── фон: холодное свечение вместо плоской заливки ────────────── */
body {
  background-color: var(--rtm-base);
  background-image:
    radial-gradient(900px 520px at 12% -8%,  rgba(37, 89, 232, .20), transparent 70%),
    radial-gradient(760px 460px at 92% 4%,   rgba(110, 92, 255, .14), transparent 72%),
    radial-gradient(680px 420px at 50% 108%, rgba(53, 207, 255, .07), transparent 70%);
  background-attachment: fixed;
}

/* ── одна семья радиусов ─────────────────────────────────────── */
.ui.segment, .ui.card, .ui.menu, .repository .ui.segment,
.ui.attached.header, .ui.attached.segment, .ui.table,
.markup, .file-view, .repo-header, .ui.message {
  border-radius: var(--rtm-r-lg) !important;
}
.ui.button, .ui.input > input, .ui.dropdown, .ui.selection.dropdown,
input[type="text"], input[type="password"], input[type="email"], textarea {
  border-radius: var(--rtm-r-md) !important;
}
.ui.label, .ui.basic.label, .branch-tag, .ui.tiny.button {
  border-radius: var(--rtm-r-sm) !important;
}

/* ── шапка ───────────────────────────────────────────────────── */
#navbar, .ui.top.menu.navbar {
  background: rgba(20, 26, 40, .82) !important;
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--rtm-line) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
}
#navbar .item img.ui.mini.image,
#navbar-logo img { height: 30px; width: 30px; }

/* ── карточки: тонкий кант и мягкая тень, как в системе ──────── */
.ui.segment, .ui.card, .repo-header, .ui.attached.segment {
  border: 1px solid var(--rtm-line) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .22) !important;
}
.ui.attached.header {
  border: 1px solid var(--rtm-line) !important;
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent) var(--rtm-surface) !important;
}

/* ── кнопки ──────────────────────────────────────────────────── */
.ui.primary.button, .ui.primary.buttons .button {
  background: linear-gradient(180deg, #5C86FF, var(--rtm-accent-2)) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 4px 14px rgba(37, 89, 232, .35) !important;
  transition: transform .12s ease, box-shadow .16s ease, filter .16s ease;
}
.ui.primary.button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 8px 22px rgba(37, 89, 232, .45) !important;
}
.ui.primary.button:active { transform: translateY(0); }
.ui.basic.button, .ui.button:not(.primary):not(.green):not(.red) {
  background: var(--rtm-surface-2) !important;
  border: 1px solid var(--rtm-line) !important;
  color: var(--rtm-text) !important;
}
.ui.basic.button:hover, .ui.button:not(.primary):hover { background: var(--rtm-surface-3) !important; }
.ui.green.button {
  background: linear-gradient(180deg, #57B67C, #3E9260) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}

/* ── поля ввода: фокус — акцентное кольцо ────────────────────── */
input:focus, textarea:focus, .ui.input > input:focus, .ui.selection.dropdown:focus {
  border-color: var(--rtm-accent) !important;
  box-shadow: 0 0 0 3px rgba(79, 123, 255, .22) !important;
  outline: none !important;
}

/* ── табы репозитория ────────────────────────────────────────── */
.repository .ui.tabular.menu .item.active,
.ui.tabular.menu .active.item {
  background: var(--rtm-surface-2) !important;
  border-color: var(--rtm-line) !important;
  color: var(--rtm-text-hi) !important;
  font-weight: 600;
}
.repository .ui.tabular.menu .item:hover { color: var(--rtm-subtle) !important; }

/* ── ссылки ──────────────────────────────────────────────────── */
a { color: var(--rtm-subtle); }
a:hover { color: var(--rtm-text-hi); }
.repo-title a, .flex-item-title a { color: var(--rtm-text-hi); }

/* ── код и диффы ─────────────────────────────────────────────── */
.file-view, .markup pre, .code-view {
  background: #070B16 !important;
  border-radius: var(--rtm-r-md);
}
.markup code:not(pre code) {
  background: var(--rtm-surface-2) !important;
  border-radius: 6px;
  padding: .12em .38em;
}
.diff-file-box .add-code, .lines-code.add-code { background: rgba(168, 220, 187, .10) !important; }
.diff-file-box .del-code, .lines-code.del-code { background: rgba(244, 169, 169, .10) !important; }

/* ── таблицы ─────────────────────────────────────────────────── */
.ui.table thead th { background: var(--rtm-surface-2) !important; color: var(--rtm-muted) !important;
  font-weight: 600; letter-spacing: .02em; }
.ui.table tr:hover td { background: rgba(255,255,255,.02) !important; }

/* ── полоса прокрутки ────────────────────────────────────────── */
* { scrollbar-color: var(--rtm-line) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rtm-line); border-radius: 6px;
  border: 2px solid var(--rtm-base); }
::-webkit-scrollbar-thumb:hover { background: #3A456A; }

/* ── страница входа: марка крупно ────────────────────────────── */
.user.signin .ui.container { max-width: 460px; }
