:root {
  --surface: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #facc15;
  --accent-text: #1f2937;
  --danger: #f87171;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.95)), url('/static/bg-main.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.portal-app {
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
}

.portal-main {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 48px;
  animation: fadeIn 0.9s ease-out forwards;
}

.portal-hero {
  text-align: center;
  padding: 36px 8px 14px;
}

.portal-title {
  margin: 0;
  font-size: clamp(3rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.portal-title-muted {
  color: #94a3b8;
  font-weight: 400;
  font-size: 0.58em;
}

.portal-subtitle {
  margin: 14px auto 0;
  max-width: 560px;
  color: #94a3b8;
  font-size: 1.05rem;
  line-height: 1.6;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

h1,
h2 {
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(24px, 3.8vw, 34px);
  font-weight: 700;
}

.muted {
  margin: 0 0 14px;
  color: #9aaec2;
  line-height: 1.6;
}

.field-label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
  color: #e2e8f0;
}

.field {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  padding: 11px 12px;
  font-size: 16px;
  outline: none;
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.25);
}

.row {
  margin-top: 12px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.btn:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--accent-text);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.7);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: #86efac;
}

.hidden {
  display: none !important;
}

.documents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.documents-actions-top {
  display: flex;
  gap: 8px;
}

.documents-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.document-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(2, 6, 23, 0.42);
}

.document-title {
  margin: 0 0 4px;
  font-size: 17px;
}

.document-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.document-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 740px) {
  .portal-app {
    padding: 14px;
  }

  .portal-hero {
    padding-top: 22px;
  }

  .portal-title {
    font-size: clamp(2.35rem, 13vw, 3.2rem);
  }

  .portal-subtitle {
    font-size: 0.98rem;
  }

  .documents-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .documents-actions-top {
    width: 100%;
  }

  .documents-actions-top .btn {
    flex: 1;
  }

  .card {
    padding: 16px;
  }
}
