/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --ink: #18212f;
  --muted: #6c7889;
  --line: #dfe7f0;
  --panel: rgba(255, 255, 255, 0.9);
  --white: #ffffff;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #eab308;
  --danger: #dc2626;
  --sky: #e0f2fe;
  --rose: #ffe4e6;
  --shadow: 0 24px 70px rgba(23, 38, 59, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
}

body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 20%, rgba(14, 165, 233, 0.2), transparent 28rem),
    radial-gradient(circle at 85% 8%, rgba(234, 179, 8, 0.2), transparent 24rem),
    linear-gradient(135deg, #f8fafc 0%, #edf7f5 48%, #fff7ed 100%);
}

.app-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.app-background::before,
.app-background::after {
  position: absolute;
  content: "";
  width: 28rem;
  height: 28rem;
  border-radius: 42% 58% 70% 30%;
  background: rgba(15, 118, 110, 0.09);
  filter: blur(1px);
  animation: floatShape 14s ease-in-out infinite alternate;
}

.app-background::before {
  left: -10rem;
  bottom: 8rem;
}

.app-background::after {
  right: -12rem;
  top: 8rem;
  background: rgba(225, 29, 72, 0.07);
  animation-delay: -5s;
}

.app-container {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.app-body .app-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(223, 231, 240, 0.8);
  backdrop-filter: blur(18px);
}

.app-body .topbar {
  position: relative;
  flex: 0 0 auto;
}

.topbar-brand,
.topbar nav,
.feature-strip,
.row-actions,
.panel-heading,
.detail-grid {
  display: flex;
  align-items: center;
}

.topbar-brand {
  gap: 10px;
}

.topbar-brand span,
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: var(--white);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.25);
}

.topbar nav {
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-shell {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 440px);
  gap: 28px;
  align-items: center;
}

.brand-panel {
  padding: clamp(28px, 7vw, 72px);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(rgba(10, 30, 45, 0.18), rgba(10, 30, 45, 0.62)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1400&q=80") center/cover;
  box-shadow: var(--shadow);
  animation: riseIn 600ms ease both;
}

.brand-panel .brand-mark {
  margin-bottom: 28px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-panel .eyebrow,
.brand-panel .lead {
  color: rgba(255, 255, 255, 0.78);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.lead {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.feature-strip {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.feature-strip span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.auth-card,
.panel,
.stat-card {
  border: 1px solid rgba(223, 231, 240, 0.92);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card {
  padding: clamp(24px, 5vw, 42px);
  animation: riseIn 600ms ease 120ms both;
}

.auth-card p {
  margin: 8px 0 24px;
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), #2563eb);
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.26);
}

.btn-light {
  color: var(--primary-dark);
  background: var(--white);
}

.btn-ghost {
  color: var(--primary-dark);
  background: rgba(15, 118, 110, 0.08);
}

.demo-logins {
  display: grid;
  gap: 6px;
  margin-top: 22px;
  padding: 14px;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(14, 165, 233, 0.08);
  font-size: 0.88rem;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 700;
  animation: riseIn 260ms ease both;
}

.flash-notice {
  color: #065f46;
  background: #d1fae5;
}

.flash-alert,
.alert-error {
  color: #991b1b;
  background: #fee2e2;
}

.field-error {
  margin: -10px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
}

.form-divider {
  height: 1px;
  margin: 2px 0;
  background: var(--line);
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  min-height: 190px;
  margin-top: 16px;
  padding: clamp(24px, 5vw, 42px);
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.78), rgba(15, 118, 110, 0.58)),
    url("https://images.unsplash.com/photo-1557804506-669a67965ba0?auto=format&fit=crop&w=1400&q=80") center/cover;
  box-shadow: var(--shadow);
  animation: riseIn 480ms ease both;
}

.page-hero .eyebrow,
.page-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.page-hero p {
  max-width: 680px;
  margin: 14px 0 0;
  line-height: 1.7;
}

.stats-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.stat-card {
  padding: 20px;
}

.stat-card span,
.panel-heading span,
.document-info span,
.detail-grid span,
.activity-item small {
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.content-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.content-grid.single-column {
  grid-template-columns: 1fr;
}

.panel {
  padding: 20px;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.content-grid > .panel {
  min-width: 0;
}

.content-grid > .panel:first-child,
.activity-panel {
  max-height: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.activity-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.folder-list {
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.content-grid > .panel:first-child .empty-state {
  margin-top: auto;
  margin-bottom: auto;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.breadcrumb a {
  color: var(--primary-dark);
}

.breadcrumb span {
  color: #94a3b8;
}

.document-list,
.activity-list,
.folder-list {
  display: grid;
  gap: 12px;
}

.folder-search {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.select-field {
  display: grid;
  gap: 6px;
}

.select-field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
  outline: none;
}

.folder-group {
  display: grid;
  gap: 10px;
}

.folder-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #134e4a;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(234, 179, 8, 0.14));
}

.folder-group-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.document-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.document-row:hover {
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: 0 16px 38px rgba(23, 38, 59, 0.1);
  transform: translateY(-2px);
}

.folder-download-row p {
  margin: 5px 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.folder-download-row.with-purpose-request {
  align-items: start;
  grid-template-columns: 58px minmax(0, 1fr);
}

.folder-download-row.with-purpose-request .row-actions {
  grid-column: 1 / -1;
  width: 100%;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 64px;
  border-radius: 8px;
  color: #9f1239;
  background: linear-gradient(160deg, var(--rose), #ffffff);
  font-size: 0.75rem;
  font-weight: 900;
}

.folder-icon {
  color: #134e4a;
  background: linear-gradient(160deg, #ccfbf1, #ffffff);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #134e4a;
  background: rgba(15, 118, 110, 0.1);
  font-size: 0.88rem;
  font-weight: 800;
}

.document-info p {
  margin: 5px 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.row-actions {
  justify-content: flex-end;
}

.otp-request-form {
  display: grid;
  width: 100%;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.88), rgba(255, 255, 255, 0.94));
}

.purpose-field {
  display: grid;
  gap: 8px;
}

.purpose-field > div,
.purpose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.purpose-field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.purpose-field span,
.purpose-actions span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.otp-request-form textarea {
  min-height: 112px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.otp-request-form .btn {
  min-width: 150px;
}

.document-otp-request {
  margin-top: 18px;
  max-width: 720px;
}

.empty-state {
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.48);
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.empty-state.compact {
  padding: 24px 16px;
}

.activity-item {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(224, 242, 254, 0.55));
  box-shadow: 0 12px 28px rgba(23, 38, 59, 0.08);
}

.activity-item::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--primary);
  content: "";
}

.activity-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.activity-topline .status-pill {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.activity-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.activity-details div:nth-child(3),
.activity-details .wide {
  grid-column: 1 / -1;
}

.activity-details div {
  display: grid;
  gap: 2px;
}

.activity-details dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.app-body .app-container::-webkit-scrollbar,
.activity-list::-webkit-scrollbar {
  width: 10px;
}

.app-body .app-container::-webkit-scrollbar-thumb,
.activity-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.32);
  background-clip: padding-box;
}

.app-body .app-container::-webkit-scrollbar-track,
.activity-list::-webkit-scrollbar-track {
  background: transparent;
}

.form-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
}

.form-panel,
.otp-panel {
  width: min(760px, 100%);
}

.form-panel h1,
.otp-panel h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.file-drop {
  padding: 18px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
}

.file-drop span {
  color: var(--primary-dark);
}

.file-drop small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.detail-grid {
  align-items: stretch;
  gap: 12px;
  margin: 22px 0;
}

.detail-grid div {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.08);
}

.detail-grid strong {
  display: block;
  margin-top: 8px;
}

.detail-copy {
  color: var(--muted);
  line-height: 1.7;
}

.otp-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 6vw, 50px);
  text-align: center;
}

.otp-panel .lead {
  margin-left: auto;
  margin-right: auto;
}

.otp-form {
  max-width: 360px;
  margin: 26px auto 0;
  text-align: left;
}

.otp-form input {
  text-align: center;
  font-size: 1.45rem;
  font-weight: 900;
}

.otp-visual {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}

.otp-visual span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseDot 1.2s ease-in-out infinite;
}

.otp-visual span:nth-child(2) {
  animation-delay: 160ms;
  background: #2563eb;
}

.otp-visual span:nth-child(3) {
  animation-delay: 320ms;
  background: var(--accent);
}

.subtle-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--primary-dark);
  font-weight: 800;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

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

@keyframes floatShape {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  to {
    transform: translate3d(24px, -24px, 0) rotate(12deg);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 860px) {
  .app-body .app-container {
    overflow-y: auto;
  }

  .login-shell,
  .content-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-hero,
  .detail-grid {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topbar nav {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar nav > span {
    flex-basis: 100%;
  }

  .page-hero {
    min-height: 220px;
  }

  .content-grid > .panel:first-child,
  .activity-panel {
    max-height: none;
    min-height: 0;
  }

  .activity-list {
    max-height: 52vh;
  }

  .document-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .folder-search {
    grid-template-columns: 1fr;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .row-actions .btn,
  .row-actions form {
    width: 100%;
  }

  .purpose-field > div,
  .purpose-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .purpose-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .app-container {
    width: min(100% - 20px, 1180px);
    padding: 16px 0 32px;
  }

  .topbar {
    padding: 12px 10px;
  }

  .topbar-brand span,
  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .topbar nav {
    gap: 8px;
  }

  .topbar nav .btn,
  .topbar nav form {
    flex: 1 1 0;
  }

  .topbar nav .btn {
    width: 100%;
    min-height: 38px;
    padding: 9px 12px;
  }

  .brand-panel,
  .page-hero,
  .panel,
  .auth-card {
    padding: 20px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .stats-grid {
    gap: 10px;
    margin: 12px 0;
  }

  .stat-card {
    padding: 16px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .activity-details {
    grid-template-columns: 1fr;
  }

  .activity-details div:nth-child(3) {
    grid-column: auto;
  }

  .activity-topline {
    align-items: flex-start;
    flex-direction: column;
  }
}
