
* {
  box-sizing: border-box;
}

:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  background: #f4f4f4;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f4f4f4;
}

[hidden] {
  display: none !important;
}

/* Header */

.site-header {
  background: #fff;
  border-bottom: 1px solid #d0d0d0;
  padding: 18px 28px;
}

.brand {
  max-width: 1100px;
  margin: 0 auto;
}

.brand::before {
  display: none;
}

.brand h1 {
  margin: 0;
  color: #111;
  font-size: 24px;
  font-weight: 700;
}

.brand p {
  margin: 4px 0 0;
  color: #555;
  font-size: 14px;
}

/* Main layout */

.container {
  width: 100%;
  max-width: 1000px;
  margin: 38px auto;
  padding: 0 20px;
  flex: 1;
}

/* Login and signup cards */

.auth-card {
  width: 100%;
  max-width: 672px;
  margin: 0 auto;
  padding: 32px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10);
}

.auth-card h2 {
  margin: 0 0 25px;
  color: #111;
  font-size: 30px;
  font-weight: 700;
  text-align: center;
}

.auth-card > p {
  color: #333;
  font-size: 14px;
  line-height: 1.6;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 45px;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 14px;
}

input:focus {
  outline: 2px solid #80b5f5;
  outline-offset: 1px;
  border-color: #0670dc;
}

/* Buttons */

button {
  min-height: 35px;
  padding: 8px 16px;
  border: 1px solid #888;
  border-radius: 3px;
  background: #f7f7f7;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: #e9e9e9;
}

button:focus-visible {
  outline: 2px solid #0670dc;
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-card form button {
  align-self: flex-end;
  min-width: 84px;
  margin-top: 14px;
}

#loginButton,
#signupButton,
#checkApprovalButton {
  border-color: #0670dc;
  background: #0670dc;
  color: #fff;
}

#loginButton:hover,
#signupButton:hover,
#checkApprovalButton:hover {
  background: #005bb5;
}

.text-button {
  min-height: 0;
  padding: 2px 4px;
  border: none;
  background: transparent;
  color: #0670dc;
  font-size: 14px;
}

.text-button:hover {
  background: transparent;
  text-decoration: underline;
}

.auth-card > p:last-child {
  margin-top: 22px;
  text-align: center;
}

/* Approval pending */

#pendingView {
  text-align: center;
}

#pendingView h2 {
  margin-bottom: 18px;
}

#pendingView button {
  margin: 8px 4px 0;
}

.secondary-button {
  border: 1px solid #999;
  background: #f7f7f7;
  color: #111;
}

.secondary-button:hover {
  background: #e8e8e8;
}

/* PDF library */

.library {
  padding: 28px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.library-heading,
.library-toolbar,
.viewer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.library-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.library-heading h2 {
  margin: 0;
  font-size: 26px;
}

#signedInAs {
  color: #555;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.library-toolbar {
  margin: 22px 0 12px;
}

.library-toolbar h3,
.viewer-heading h3 {
  margin: 0;
  font-size: 17px;
}

#libraryMessage,
#globalMessage {
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

#libraryMessage {
  color: #444;
}

#globalMessage {
  max-width: 672px;
  margin: 18px auto;
  text-align: center;
}

#libraryMessage:empty,
#globalMessage:empty {
  display: none;
}

/* PDF list */

.pdf-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pdf-list li {
  margin: 8px 0;
}

.pdf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 55px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #222;
  text-align: left;
}

.pdf-item:hover {
  border-color: #aaa;
  background: #f6f6f6;
}

.pdf-icon {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f1f1f1;
  color: #333;
  font-size: 11px;
  font-weight: 700;
}

.pdf-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Document viewer */

#viewerPanel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.viewer-heading {
  margin-bottom: 12px;
}

#viewerTitle {
  overflow-wrap: anywhere;
}

#pdfViewer {
  display: block;
  width: 100%;
  height: 70vh;
  border: 1px solid #ccc;
  background: #eee;
}

/* Footer */

.site-footer {
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid #ccc;
  background: #fff;
  color: #555;
  text-align: center;
  font-size: 12px;
}

.site-footer p {
  margin: 4px 0;
}

/* Mobile */

@media (max-width: 600px) {
  .site-header {
    padding: 16px 20px;
  }

  .container {
    margin: 24px auto;
    padding: 0 12px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .auth-card h2 {
    font-size: 26px;
  }

  .library {
    padding: 18px;
  }

  .library-heading {
    align-items: flex-start;
  }

  .library-heading h2 {
    font-size: 22px;
  }

  .library-toolbar h3 {
    font-size: 15px;
  }

  #pdfViewer {
    height: 60vh;
  }
}
