@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #FAFAFA;
  --bg-content: #F5F5F4;
  --surface: #FFFFFF;
  --surface-2: #F2F2F0;
  --border: #E2E2E0;
  --text: #262626;
  --text-muted: #8A8A87;
  --accent: #5ea4c8;
  --accent-dark: #3E7C9C;
  --accent-tint: rgba(94, 164, 200, 0.14);
  --ok: #7A9B6E;
  --warn: #C9A876;
  --stop: #B4695A;
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);

  --font-display: 'Jost', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
}

/* ---------- Login ---------- */

#loginView {
  min-height: 100vh;
  display: flex;
}

.login-hero {
  flex: 0 0 60%;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 60px 90px;
  background-image: url('Imagens/login-bg.jpeg');
  background-size: cover;
  background-position: center;
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.login-hero .login-mark,
.login-hero h1 {
  position: relative;
  z-index: 1;
}

.login-hero .login-mark {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.7);
  display: inline-block;
  padding: 6px 14px;
  border-radius: 3px;
  margin-bottom: 24px;
}

.login-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 40px;
  letter-spacing: 0.005em;
  line-height: 1.25;
  color: #FFFFFF;
  max-width: 560px;
  margin: 0;
}

.login-panel {
  flex: 0 0 40%;
  min-height: 100vh;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 40px 32px;
}

.login-card h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 0 0 28px;
  line-height: 1.25;
}

.btn-primary {
  width: 100%;
  background: var(--text);
  color: #FFFFFF;
  border: none;
  padding: 13px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
}

.btn-primary:hover { background: var(--accent-dark); }

#loginError {
  color: var(--stop);
  font-size: 13px;
  margin-top: 14px;
  min-height: 1em;
}

@media (max-width: 800px) {
  #loginView { flex-direction: column; }

  .login-hero {
    flex: none;
    min-height: 260px;
    padding: 0 28px 32px;
  }

  .login-hero h1 { font-size: 28px; }

  .login-panel {
    flex: none;
    min-height: 0;
    padding: 32px 20px;
  }
}

/* ---------- App shell ---------- */

#demandasView {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-content);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.app-logo {
  width: 170px;
  height: auto;
  margin-right: 16px;
}

.app-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--text);
  flex: 1;
}

.btn-secondary {
  background: var(--surface-2);
  border: none;
  color: var(--text);
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover { color: var(--accent-dark); }

/* ---------- Cards ---------- */

.cards-wrapper {
  flex: 1;
  padding: 22px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.cards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demanda-card {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 20px 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-numero {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  color: var(--accent-dark);
}

.card-categoria {
  background: var(--accent-tint);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.card-body {
  margin-bottom: 16px;
}

.card-cliente {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
}

.btn-ver-pdf {
  background: var(--surface-2);
  color: var(--text);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ver-pdf:hover { color: var(--accent-dark); }

.empty-message {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 14px;
}

/* ---------- PDF Modal ---------- */

.pdf-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.pdf-modal-content {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 900px;
  height: 90vh;
  position: relative;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.pdf-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.btn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: var(--surface);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  color: var(--text);
}

[hidden] {
  display: none !important;
}
