:root{
  --bg: #EAF2FB;
  --bg-2: #DCE9F8;
  --panel: #FFFFFF;
  --ink: #10243F;
  --ink-soft: rgba(16,36,63,0.62);
  --accent: #2E6FBE;
  --accent-light: #4E85CC;
  --line: rgba(16,36,63,0.10);
}
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.flow-lines{
  position:fixed; inset:0;
  background-image:
    repeating-linear-gradient(100deg, transparent 0 90px, var(--line) 90px 91px),
    repeating-linear-gradient(10deg, transparent 0 140px, var(--line) 140px 141px);
  opacity:0.6;
  pointer-events:none;
  z-index:0;
}

/* ---------- LOGOWANIE: układ dwukolumnowy na cały ekran ---------- */
.gate-wrap{
  min-height:100vh;
  display:grid;
  grid-template-columns: 1.3fr 1fr;
  position:relative;
  z-index:2;
}

.gate-hero{
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding: 8vh 7vw;
  animation: rise 0.6s ease;
}

.eyebrow{
  font-size:14px;
  color: var(--accent);
  letter-spacing:0.04em;
  text-transform:uppercase;
  margin-bottom:22px;
  font-weight:600;
}

.brand-hero{
  font-family:'Inter', sans-serif;
  font-weight:700;
  font-size:clamp(52px, 7.5vw, 96px);
  line-height:1.02;
  letter-spacing:-0.02em;
  color: var(--ink);
  margin-bottom:32px;
}

.sub{
  font-size:17px;
  color: var(--ink-soft);
  line-height:1.65;
  max-width:52ch;
  margin-bottom:18px;
}
.sub:last-of-type{ margin-bottom:0; }

.gate-form-panel{
  background: var(--panel);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 0 6vw;
  border-left: 1px solid var(--line);
  animation: rise 0.6s ease 0.1s both;
}

#gate{ width:100%; max-width:360px; }

@keyframes rise{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

h2.form-title{
  font-family:'Fraunces', serif;
  font-weight:500;
  font-size:24px;
  margin-bottom:28px;
  color: var(--ink);
}

form{ display:flex; flex-direction:column; gap:16px; }
label{ font-size:13px; color: var(--ink-soft); margin-bottom:6px; display:block; }
.field{ display:flex; flex-direction:column; }

input{
  background: rgba(234,242,251,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(16,36,63,0.14);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(16,36,63,0.04);
  transition: border-color 0.15s ease, background 0.15s ease;
}
input::placeholder{ color: rgba(16,36,63,0.32); }
input:focus{ border-color: var(--accent); background: rgba(255,255,255,0.75); }

button{
  margin-top:10px;
  background: var(--accent);
  color: #FFFFFF;
  border:none;
  border-radius:8px;
  padding: 14px 18px;
  font-size:15px;
  font-weight:600;
  font-family:'Inter', sans-serif;
  cursor:pointer;
  transition: background 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
}
button:hover{ background: var(--accent-light); }
button:active{ transform: scale(0.99); }
button:disabled{ opacity:0.75; cursor:default; }

button.loading .btn-label::after{
  content: "...";
  display:inline-block;
  width: 1.1em;
  overflow: hidden;
  vertical-align: bottom;
  white-space:nowrap;
  animation: dotsAnim 1s steps(4, end) infinite;
}
@keyframes dotsAnim{
  0%{ width:0; }
  100%{ width:1.1em; }
}

.error{
  background: rgba(46,111,190,0.08);
  border: 1px solid rgba(46,111,190,0.25);
  color: var(--accent);
  font-size:13px;
  padding: 10px 12px;
  border-radius:6px;
}

@media (max-width: 860px){
  .gate-wrap{ grid-template-columns: 1fr; }
  .gate-hero{ padding: 8vh 8vw 4vh; }
  .gate-form-panel{ border-left:none; border-top:1px solid var(--line); padding: 4vh 8vw 8vh; }
}

/* ---------- PORTAL (Z OSADZONYM OPEN WEBUI) ---------- */
.topbar{
  height:48px;
  background: var(--panel);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 20px;
  font-size:13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  position:relative;
  z-index:2;
}

.topbar .brand{
  display:flex;
  align-items:center;
  gap:8px;
  font-family:'Fraunces', serif;
  font-weight:600;
  font-size:16px;
  color: var(--ink);
}

.dot{ width:6px; height:6px; border-radius:50%; background: var(--accent); }

.topbar .right{
  display:flex;
  align-items:center;
  gap:14px;
}

.who{ color: var(--ink-soft); }

.logout-btn{
  background:none;
  border:1px solid var(--line);
  color: var(--ink-soft);
  font-size:12px;
  padding:6px 14px;
  border-radius:5px;
  cursor:pointer;
  font-family:'Inter', sans-serif;
  text-decoration:none;
}
.logout-btn:hover{ border-color: var(--accent); color: var(--accent); }

.workspace{
  display:grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 48px);
}

.sidebar{
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 20px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
}

.sidebar-title{
  font-family:'Inter', sans-serif;
  font-weight:700;
  font-size:17px;
  color: var(--ink);
  margin-bottom:6px;
}

.sidebar-hint{
  font-size:13px;
  color: var(--ink-soft);
  line-height:1.5;
  margin-bottom:18px;
}

.dropzone{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:4px;
  border: 1.5px dashed var(--line);
  border-radius:10px;
  padding: 26px 14px;
  cursor:pointer;
  background: var(--bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover{
  border-color: var(--accent);
  background: rgba(46,111,190,0.06);
}
.dropzone-title{ font-size:14px; font-weight:600; color: var(--ink); }
.dropzone-sub{ font-size:12px; color: var(--ink-soft); max-width:26ch; }

.notice{
  margin-top:16px;
  font-size:12px;
  line-height:1.6;
  color: var(--ink-soft);
  background: rgba(46,111,190,0.06);
  border: 1px solid rgba(46,111,190,0.18);
  border-radius:8px;
  padding: 10px 12px;
}
.notice code{
  font-family: monospace;
  background: rgba(16,36,63,0.08);
  padding: 1px 5px;
  border-radius:4px;
}

.file-list{ margin-top:20px; display:flex; flex-direction:column; gap:10px; }

.empty-hint{ font-size:13px; color: var(--ink-soft); margin-top:6px; }

.file-row{
  border: 1px solid var(--line);
  border-radius:8px;
  padding: 10px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.file-info{ display:flex; flex-direction:column; gap:2px; }
.file-name{ font-size:13px; font-weight:600; color: var(--ink); word-break:break-all; }
.file-size{ font-size:12px; color: var(--ink-soft); }

.file-actions{ display:flex; gap:8px; }
.file-actions form{ margin:0; }

.btn-small{
  font-family:'Inter', sans-serif;
  font-size:12px;
  font-weight:600;
  padding: 6px 12px;
  border-radius:6px;
  cursor:pointer;
  border:1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-send{ border-color: rgba(46,111,190,0.35); color: var(--accent); }
.btn-send:hover{ background: var(--accent); color:#fff; border-color: var(--accent); }
.btn-delete:hover{ background: rgba(200,50,50,0.08); border-color: rgba(200,50,50,0.3); color:#B23A3A; }

.flash-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.flash{
  font-size:12px;
  padding: 9px 11px;
  border-radius:7px;
  line-height:1.5;
}
.flash-success{ background: rgba(46,111,190,0.08); color: var(--accent); border:1px solid rgba(46,111,190,0.22); }
.flash-error{ background: rgba(200,50,50,0.07); color:#B23A3A; border:1px solid rgba(200,50,50,0.2); }

.frame-wrap{ position:relative; z-index:2; height:100%; }

iframe{
  width:100%;
  height: 100%;
  border:none;
  background: white;
  display:block;
}
