/* Acalution Intranet — shared styles (brand foundation + shell) */
/* Self-hosted Comfortaa (no external dependency — renders in any context) */
@font-face { font-family: 'Comfortaa'; font-style: normal; font-weight: 300; font-display: swap; src: url('/assets/fonts/comfortaa-300.woff2') format('woff2'); }
@font-face { font-family: 'Comfortaa'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/comfortaa-400.woff2') format('woff2'); }
@font-face { font-family: 'Comfortaa'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/comfortaa-700.woff2') format('woff2'); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Always reserve the scrollbar gutter so switching between short and tall
   views (e.g. directory/library filters and tabs) doesn't shift the page. */
html { scrollbar-gutter: stable; overflow-y: scroll; }

:root {
  --green:       #93BA2F;
  --green-node:  #A8D048;
  --green-icon:  #B8E848;
  --charcoal:    #413F42;
  --bg:          #F2F2F0;
  --surface:     #ffffff;
  --border:      #DCDEE0;
  --text:        #413F42;
  --muted:       #6b7280;
  --accent-line: #C8C86A;
  --radius:      6px;
  --shadow:      0 1px 3px rgba(65,63,66,.08), 0 1px 2px rgba(65,63,66,.05);
  --font-display:'Comfortaa', Arial, sans-serif;
  --font-body:   Arial, Helvetica, sans-serif;
}

body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; }

h1, h2, h3 { font-family: var(--font-display); color: var(--charcoal); font-weight: 400; }

/* ── Header ── */
.app-header {
  background: #fff; padding: 0 2rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(65,63,66,.06);
}
.app-header .left { display: flex; align-items: center; gap: 1rem; }
.app-header .left img { height: 30px; }
.app-header .divider { width: 1px; height: 22px; background: var(--border); }
.app-header .section {
  font-family: var(--font-display); font-size: .9rem; font-weight: 700;
  color: var(--green); letter-spacing: .08em; text-transform: uppercase;
  /* Drop the label ~2px so it sits on the logo wordmark's baseline (which is
     low in the logo image) instead of the flex centre line. */
  position: relative; top: 2px;
}
.app-header .back {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); font-size: .78rem; color: var(--muted);
  text-decoration: none; background: #fff;
  padding: .35rem .8rem .35rem .6rem; border: 1px solid var(--border); border-radius: 20px;
  transition: color .15s, border-color .15s, background .15s;
}
.app-header .back svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.app-header .back:hover { color: var(--green); border-color: var(--green); background: #F4F8EC; }
.app-header .back:hover svg { transform: translateX(-2px); }
.app-header .user { display: flex; align-items: center; gap: .65rem; font-size: .8rem; color: var(--muted); }
.app-header .user .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: .7rem; font-weight: 700; letter-spacing: .02em;
  flex-shrink: 0;
}
.app-header .user .uname { color: var(--charcoal); font-weight: 700; font-size: .82rem; }
@media (max-width: 560px) { .app-header .user .uname { display: none; } }
.btn-signout {
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  border-radius: var(--radius); padding: .3rem .85rem; cursor: pointer; font-size: .78rem;
  font-family: var(--font-body); transition: border-color .15s, color .15s;
}
.btn-signout:hover { border-color: var(--charcoal); color: var(--charcoal); }

/* ── Auth / sign-in screen ── */
.auth-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: var(--surface); border-radius: 8px; padding: 2.5rem 3rem;
  box-shadow: 0 4px 24px rgba(65,63,66,.12); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem; min-width: 340px;
}
.auth-card img { height: 32px; margin-bottom: .25rem; }
.auth-divider { width: 40px; height: 2px; background: var(--green); border-radius: 2px; }
.auth-card h1 { font-size: 1.35rem; }
.auth-card p  { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.auth-error { display: none; color: #c0392b; font-size: .8rem; line-height: 1.4; max-width: 280px; margin-top: .25rem; }
.btn-signin {
  background: var(--charcoal); color: #fff; border: none; border-radius: var(--radius);
  padding: .75rem 2rem; font-size: .95rem; font-family: var(--font-body); font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: .6rem; transition: background .15s; margin-top: .25rem;
}
.btn-signin:hover { background: #2d2b2f; }
.btn-signin svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Loading ── */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 1rem; }
.loading img { height: 28px; opacity: .4; }
.loading-dots { display: flex; gap: .4rem; }
.loading-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%,80%,100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ── Footer ── */
.app-footer {
  border-top: 1px solid var(--border); background: #fff;
  padding: 1.5rem 2rem; margin-top: 3rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .72rem; color: var(--muted);
}
.app-footer .tag {
  font-family: var(--font-display); letter-spacing: .12em; text-transform: uppercase;
  font-size: .62rem; color: var(--green);
}

/* ── Buttons ── */
.btn-primary {
  background: var(--green); color: #fff; border: none; border-radius: var(--radius);
  padding: .6rem 1.25rem; font-size: .875rem; font-family: var(--font-body); font-weight: 500;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: #7fa028; }
