@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #F3F4F6;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --text: #111827;
  --muted: #6B7280;
  --success: #059669;
  --label: #374151;
  --input-bg: #F9FAFB;
  --radius: 16px;
  --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ── Login Portal ── */
.login-container {
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem 2rem;
  border-radius: 1.25rem;
}

.container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.app-logo {
  max-width: 250px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

h1.app-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.app-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
}

.container {
  width: 100%;
  max-width: 800px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 15px 50px -10px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: black;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--label);
}

input,
select,
textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: #FFF;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

input[readonly] {
  background: #F3F4F6;
  color: var(--muted);
  cursor: not-allowed;
}

input.invoice-display {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  background: #FFF;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.1);
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

select option {
  background: var(--card);
}

/* Charges table */
.charges-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
}

.charges-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.charges-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.charges-table tr:last-child td {
  border-bottom: none;
}

.charges-table .row-label {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.charges-table .total-row td {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  border-top: 2px solid var(--border);
}

.charges-table .readonly-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 10px;
  display: block;
  min-width: 120px;
}

.charges-table .total-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--card);
  padding: 0.75rem 1rem;
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 10px;
  display: block;
}

/* Disclaimer */
.disclaimer {
  background: #c727271a;
  border: 1px solid #c727271a;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: #dc2626;
  margin-top: 1.5rem;
  font-style: italic;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.disclaimer::before {
  content: "";
  font-style: normal;
}

/* Labor fixed badge */
.fixed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c0c4c2;
  color: #000000;
  border: 1px solid #c0c4c2;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  height: 44px;
  /* matches input height */
}

/* Generate button */
.btn-generate {
  width: 100%;
  padding: 1.1rem;
  background: #dc2626;
  /* Red */
  border: none;
  border-radius: 9999px;
  /* Pill shape */
  color: #fff;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-generate:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.4);
}

.btn-secondary {
  background: #c727271a;
  /* Soft pink */
  color: #dc2626;
  /* Red text */
}

.btn-secondary:hover {
  background: #c727272a;
  /* Slightly darker pink on hover */
  box-shadow: 0 10px 20px -5px rgba(199, 39, 39, 0.2);
}

.btn-generate:active {
  transform: scale(0.98);
}

.btn-generate svg {
  width: 22px;
  height: 22px;
}

/* Invoice # pill */
.invoice-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.invoice-row input {
  flex: 1;
}

.btn-reset-invoice {
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 1rem;
  height: 44px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-reset-invoice:hover {
  border-color: var(--text);
  background: var(--text);
  color: #FFF;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text);
  border: none;
  border-radius: 12px;
  color: #FFF;
  padding: 1rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  transform: translateY(150%) scale(0.9);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toast::before {
  content: "✓";
}

.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (max-width: 600px) {

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.5rem;
  }

  body {
    padding: 1.5rem 1rem;
  }
}