/* Frontend (runs in the browser): CSS (how it’s styled) */

.title-purple { color: #7c3aed; } /* purple-600-ish */
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0.5rem 2rem 1rem;
  color: #1f2937;
}
h2, h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 .25rem;
  color: #7c3aed;
}
.sub { color:#6b7280; margin:.25rem 0 1rem; }
label { font-weight: 600; }
.block { display:block; margin:.4rem 0; }
.indent { margin-left:1.5rem; }
.hint { color:#6b7280; font-size:.9rem; margin:.25rem 0 .75rem; }
.actions { margin-top: 1rem; }

/* inputs */
input[type="text"], input[type="password"], select {
  max-width: 100%; width: 100%;
  padding:.6rem .7rem; border:1px solid #d1d5db; border-radius:8px;
}

/* primary button */
.btn-import {
  appearance: none;
  border: 0;
  padding: .8rem 1.25rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background-image: linear-gradient(135deg, #7c3aed, #2563eb);
  box-shadow: 0 8px 20px rgba(124,58,237,.35);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-import:hover { filter: brightness(1.05); box-shadow: 0 10px 24px rgba(124,58,237,.45); }
.btn-import:active { transform: translateY(1px) scale(.99); }
.btn-import:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.btn-import[disabled] { opacity:.6; cursor:not-allowed; filter:none; box-shadow:none; }

/* secondary ghost gradient button */
.btn-ghost-gradient {
  appearance: none;
  border: 2px solid transparent;
  padding: .6rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #7c3aed, #2563eb) border-box;
  color: #7c3aed;
  transition: background .15s ease, color .15s ease, transform .1s ease, box-shadow .2s ease;
  text-decoration: none;
}
.btn-ghost-gradient:hover {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(124,58,237,.25);
  text-decoration: none;
}
.btn-ghost-gradient:active { transform: translateY(1px); }
.btn-ghost-gradient[disabled] { opacity:.6; cursor:not-allowed; box-shadow:none; }

/* sections */
.section { margin-top: .2rem; padding-top: .2rem; border-top: 1px solid #e5e7eb; }
fieldset { border:1px solid #e5e7eb; border-radius:10px; padding:1rem; margin:.8rem 0; }
legend { padding:0 .4rem; color:#374151; font-weight:600; }

@media (prefers-reduced-motion: reduce) {
  .btn-import, .btn-ghost-gradient { transition: none; }
}

/* logs */
#logsWrap { margin-top: 1rem; }
#logs {
  background: #0b1020; color: #e6edf3;
  padding: 12px 14px; border-radius: 10px; overflow:auto; max-height: 40vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.4;
}

/* make sizing predictable so padding doesn't cause overflow */
*, *::before, *::after { box-sizing: border-box; }

/* full-height baseline so centering works */
html, body { height: 100%; }

/* drop the global body margin only on the login page */
body.login { margin: 0; }

.login-wrap { min-height: 100dvh; display:flex; place-items:center; padding: 16px }
.login-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; width: min(92vw, 420px); background:#fff; }
.error { color:#b91c1c; margin-top:.5rem; }

.logo-wrapper { 
  text-align: center;
  margin-bottom: 0.75rem;
}
.rok-logo {
  max-width: 220px;
  width: 70%;
  height: auto;
  display: inline-block;
}

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* logo left, actions right */
  gap: .75rem;
  padding: .35rem 0;
  flex-wrap: wrap;                  /* allow wrap on tiny screens */
}

.topbar-spacer {
  flex: 1;
}
/* Left: logo only */
.topbar .brand { 
  display: flex; 
  align-items: center; 
  text-decoration: none; 
  margin-right: auto;                      /* pushes the rest to the right */
}

/* Reuse the same login logo image, but small in the top bar */
.topbar .rok-logo {
  height: 28px;                            /* size in the header */
  width: auto;
  max-width: none;                         /* override login's max-width */
  display: block;
}

.brand-text {
  font-size: .95rem;          /* match user text size */
  color: #374151;             /* gray-700 */
  font-weight: 600;
  line-height: 1.2;
}

/* Right side: user + logout */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: .6rem;                 /* control spacing between text and button */
}
.topbar-user {
  color: #374151;       /* gray-700 */
  font-size: .95rem;
  line-height: 1.1;
  margin: 0;
}

/* smaller variant of your ghost gradient button */
.btn-small {
  padding: .35rem .7rem;
  font-size: .9rem;
  border-width: 1.5px;
  line-height: 1;
}
.logout-link { text-decoration: none; }

/* Remove any brand text if left in markup */
.brand-text { display: none !important; }

/* >= 640px (tablets+): slightly bigger logo, same spacing */
@media (min-width: 1024px) {
  .topbar .rok-logo { height: 50px; margin-top: -2px; }
  .topbar {
      margin-left: -0.65rem;   /* try -0.75rem to -1.5rem to taste */
      padding-left: 0;
  }
}

/* <= 480px (small phones): let the right side drop to next line, right-aligned */
@media (max-width: 480px) {
  .topbar { 
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: .5rem;
    margin-left: -0.3rem;   /* try -0.75rem to -1.5rem to taste */
    padding: .25rem 0; 
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-end;      /* right align on its own line */
    display: contents;
  }
  .topbar-user { 
    grid-column: 2;
    justify-self: end;
    max-width: 62vw;               /* show more of the username */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: .9rem;
    line-height: 1.1;
  }
    .logout-link     {
    grid-column: 3;
    justify-self: end;
    padding: .28rem .55rem;        /* smaller pill on phones */
    font-size: .85rem;
    line-height: 1;
  }

  .topbar .rok-logo { height: 34px; margin-top: -2px; }  /* adjust if you want a hair bigger */
  .btn-small { font-size: .95rem; padding: .4rem .85rem; }
  .signed-label { display: none; }
}
