:root {
  --muted: #9bb09a;
  --surface: #1c3228;
}

.gate-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.gate-card {
  width: min(100%, 440px);
  background: var(--surface, #1c3228);
  border: 1px solid rgba(196, 214, 180, 0.14);
  border-radius: 16px;
  padding: 1.6rem 1.4rem 1.4rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.gate-card h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.45rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.gate-card .lede {
  margin: 0 0 1.15rem;
  color: var(--muted, #9bb09a);
  font-size: 0.92rem;
}

.gate-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.gate-field label {
  font-size: 0.8rem;
  color: var(--muted, #9bb09a);
  font-weight: 600;
}

.gate-field input[type="text"],
.gate-field input[type="password"],
.gate-field input[type="file"] {
  border: 1px solid rgba(196, 214, 180, 0.14);
  background: #0f1f17;
  color: #e8f0e2;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: inherit;
  width: 100%;
}

.gate-field input[readonly] {
  opacity: 0.9;
  background: #152820;
  color: #b7f0bf;
  cursor: not-allowed;
}

.gate-field input:focus {
  outline: 2px solid rgba(111, 191, 122, 0.45);
  outline-offset: 1px;
}

.gate-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: #6fbf7a;
  color: #0f1f17;
  margin-top: 0.25rem;
}

.gate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gate-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.gate-btn-secondary {
  background: transparent;
  border: 1px solid rgba(111, 191, 122, 0.45);
  color: #e8f0e2;
  margin-bottom: 0.75rem;
}

.gate-error {
  background: rgba(224, 122, 106, 0.15);
  color: #f0b0a6;
  border: 1px solid rgba(224, 122, 106, 0.35);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
  white-space: pre-wrap;
}

.gate-ok {
  background: rgba(111, 191, 122, 0.14);
  color: #b7f0bf;
  border: 1px solid rgba(111, 191, 122, 0.35);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  margin-bottom: 0.85rem;
}

.gate-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.gate-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #6fbf7a, #3d8f4a);
  box-shadow: 0 8px 24px rgba(61, 143, 74, 0.35);
  flex-shrink: 0;
}

.gate-brand-name {
  margin: 0;
  font-weight: 800;
  font-size: 1.05rem;
}

.gate-brand-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted, #9bb09a);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.auth-tab {
  border: 1px solid rgba(196, 214, 180, 0.14);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 0.55rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-tab.is-active {
  background: rgba(111, 191, 122, 0.16);
  color: #e8f0e2;
  border-color: rgba(111, 191, 122, 0.4);
}

.ocr-rules {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.ocr-locked {
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(196, 214, 180, 0.12);
}

.branch-accordion {
  margin-top: 1rem;
  border: 1px solid rgba(196, 214, 180, 0.18);
  border-radius: 12px;
  background: rgba(12, 24, 18, 0.45);
  overflow: hidden;
}

.branch-accordion-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text, #e8f0e2);
  user-select: none;
}

.branch-accordion-title::-webkit-details-marker {
  display: none;
}

.branch-accordion-title::after {
  content: "▾";
  flex-shrink: 0;
  color: var(--muted, #9bb09a);
  font-size: 0.85rem;
  transition: transform 0.15s ease;
}

.branch-accordion[open] .branch-accordion-title::after {
  transform: rotate(-180deg);
}

.branch-accordion-count {
  margin-left: auto;
  margin-right: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #b7d4a8;
  background: rgba(111, 191, 122, 0.14);
  border: 1px solid rgba(111, 191, 122, 0.28);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.branch-accordion-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(196, 214, 180, 0.12);
}

.branch-accordion-hint {
  margin: 0.75rem 0 0.65rem;
  font-size: 0.78rem;
  color: var(--muted, #9bb09a);
  line-height: 1.45;
}

.branch-kod-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 16rem;
  overflow: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.branch-kod-list li {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(196, 214, 180, 0.08);
  font-size: 0.78rem;
  line-height: 1.35;
}

.branch-kod-list li:last-child {
  border-bottom: none;
}

.branch-kod {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #e2b35a;
}

.branch-ad {
  color: var(--text, #e8f0e2);
}

.consent-box {
  margin: 1rem 0 0.85rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 179, 90, 0.28);
  background: rgba(226, 179, 90, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.consent-item {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text, #e8f0e2);
  cursor: pointer;
}

.consent-item input {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: #6fbf7a;
}

.consent-item a {
  color: #e2b35a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted, #9bb09a);
  line-height: 1.4;
}

.auth-legal-links {
  margin: 1.1rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted, #9bb09a);
}

.auth-legal-links a {
  color: #b7d4a8;
  text-decoration: none;
  font-weight: 600;
}

.auth-legal-links a:hover {
  color: #e8f0e2;
  text-decoration: underline;
}
