﻿/* ── Google Fonts ─────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&display=swap");

/* ── Variables ────────────────────────────────────────────── */
:root {
  --blue: #003883;
  --blue-dark: #002560;
  --blue-mid: #004fb3;
  --blue-light: #e8eef8;
  --blue-tint: #f0f4fb;

  --orange: #ee7d11;
  --orange-dark: #c96700;
  --orange-light: #fff3e3;

  --text: #111827;
  --text-mid: #374151;
  --text-muted: #6b7280;
  --border: #d1d9e6;
  --bg: #f4f6fb;
  --white: #ffffff;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 4px rgba(0, 56, 131, 0.08);
  --shadow: 0 4px 16px rgba(0, 56, 131, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 56, 131, 0.18);

  --font: "Barlow", sans-serif;
  --font-cond: "Barlow Condensed", sans-serif;

  --transition: 0.18s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Page wrapper ─────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--white);
  border-bottom: 3px solid var(--orange);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-cond);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  text-transform: uppercase;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--orange);
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

/* User badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: transparent;
  border: 1px solid var(--blue-mid);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ============================================================
   BUTTONS
   ============================================================ */
button {
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.button-archive {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.9rem;
  background: transparent;
  border: 1.5px solid var(--orange);
  color: var(--orange-dark);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition);
}

.button-archive::before {
  content: "📦";
  font-size: 0.85rem;
}

.button-archive:hover {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  transform: translateY(-1px);
}

.button-archive:active {
  transform: translateY(0);
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.7rem 1.4rem;
  background: var(--orange);
  color: var(--white);
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(238, 125, 17, 0.35);
}
.btn-primary:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(238, 125, 17, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  padding: 0.38rem 1rem;
  background: transparent;
  border: 1.5px solid var(--blue-mid);
  color: var(--blue-dark);
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn-danger:hover {
  background: var(--blue-mid);
  border-color: var(--blue);
  color: var(--white);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-title {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: var(--blue-tint);
}

.card-title h2 {
  font-family: var(--font-cond);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.4rem 0;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(0, 79, 179, 0.15);
  background: var(--white);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23003883' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem;
  cursor: pointer;
}

/* ── File picker ──────────────────────────────────────────── */
input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition:
    border-color var(--transition),
    background var(--transition),
    color var(--transition);
}
.file-label::before {
  content: "📎";
  font-size: 1rem;
  flex-shrink: 0;
}
.file-label:hover {
  border-color: var(--orange);
  background: var(--orange-light);
  color: var(--orange-dark);
}
.file-label.has-file {
  border-style: solid;
  border-color: var(--blue-mid);
  background: var(--blue-light);
  color: var(--blue);
}

/* ── Status message ───────────────────────────────────────── */
#uploadStatus,
#message {
  min-height: 1.4rem;
  padding: 0.5rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   DOCUMENTS LAYOUT
   ============================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  padding: 1.8rem 2rem;
  flex: 1;
  align-items: start;
}

/* ── File list ────────────────────────────────────────────── */
.file-list {
  list-style: none;
  padding: 0.5rem 0;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.4rem;
  border-bottom: 1px solid var(--blue-tint);
  font-size: 0.92rem;
  color: var(--text-mid);
  transition: background var(--transition);
}
.file-list li:last-child {
  border-bottom: none;
}
.file-list li:not(.file-empty):hover {
  background: var(--blue-tint);
}

/* File icon accent line */
.file-list li:not(.file-empty)::before {
  content: "";
  display: block;
  width: 3px;
  height: 1.4rem;
  background: var(--orange);
  border-radius: 3px;
  flex-shrink: 0;
}

/* Download link inside list item */
.file-list a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
  flex: 1;
  transition: color var(--transition);
}
.file-list a:hover {
  color: var(--orange-dark);
  text-decoration: underline;
}

.file-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.empty-icon {
  font-size: 2rem;
}

/* ── Upload panel ─────────────────────────────────────────── */
.upload-panel .card {
  position: sticky;
  top: 76px;
}
.upload-panel .btn-primary {
  margin: 1.2rem 1.4rem 0.2rem;
  width: calc(100% - 2.8rem);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background:
    radial-gradient(
      ellipse 80% 60% at 10% 80%,
      rgba(0, 38, 96, 0.55) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 60% 50% at 90% 10%,
      rgba(238, 125, 17, 0.18) 0%,
      transparent 60%
    ),
    linear-gradient(145deg, #e8eef8 0%, #f4f6fb 50%, #edf1fa 100%);
}

.login-panel {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  padding: 0 0.5rem;
}

.login-header h1 {
  font-family: var(--font-cond);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-dark);
  text-transform: uppercase;
  line-height: 1.1;
  position: relative;
  display: inline-block;
}

/* Orange underline accent on title */
.login-header h1::after {
  content: "";
  display: block;
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
  margin-top: 0.35rem;
}

.login-header p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem 0 1.2rem;
  overflow: hidden;

  /* Top border accent */
  border-top: 4px solid var(--blue);
}

.login-card .form-group {
  padding-bottom: 0;
}

.login-card .btn-primary {
  margin: 1.4rem 1.4rem 0.4rem;
  width: calc(100% - 2.8rem);
  padding: 0.8rem 1.4rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 840px) {
  .docs-layout {
    grid-template-columns: 1fr;
    padding: 1.2rem 1rem;
  }
  .upload-panel .card {
    position: static;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 1rem;
  }
  .topbar-brand {
    font-size: 1.05rem;
  }
}
