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

:root {
  color-scheme: only light;
  --spesen-max-width: 980px;
}

/* --------------------------------------------------------------------------
   Base typography (borrowed from the old form)
   -------------------------------------------------------------------------- */

body {
  background: #ffffff;
  font-size: 14px;
  color: #9199AA;
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
}

p {
  margin-bottom: 15px;
  font-size: 14px;
}

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 15px;
  line-height: 1.2;
  font-weight: 500;
}

h1 {
  font-size: 25px;
  line-height: 28px;
}

h2 { font-size: 20px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }

strong {
  font-weight: 500;
}

a:focus,
button:focus,
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: none;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   Layout (match old look, but a bit wider)
   -------------------------------------------------------------------------- */

header,
footer {
  width: 100%;
}

header {
  background: #F3F3F3 !important;
  border-bottom: none !important;
}

header .container {
  max-width: var(--spesen-max-width);
  padding: 41px 20px !important;
}

main.container {
  max-width: var(--spesen-max-width);
  padding: 50px 20px !important;
}

footer {
  background: #DADADA !important;
  border-top: none !important;
}

footer .container {
  max-width: var(--spesen-max-width);
  padding: 36px 20px 11px !important;
}

footer .text-muted,
footer .text-muted a {
  color: #6A6868 !important;
  letter-spacing: 0.09px;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
}

/* --------------------------------------------------------------------------
   Bootstrap components -> styled like the old form
   -------------------------------------------------------------------------- */

/* Remove card look (old form didn't have panels) */
.card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}

.card-body {
  padding: 0 !important;
}

/* Old form had a section divider for "Spesen" */
.card-header {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 50px 0 30px !important;
  border-bottom: 1px solid rgba(34, 51, 84, 0.2) !important;
}

.card-header .fw-semibold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700 !important;
  font-size: 16px;
  line-height: 19px;
  color: rgba(34, 51, 84, 0.5);
  background: #F6F8FB;
  padding: 10px 16px;
  margin-bottom: -18px;
  border-radius: 4px;
}

/* Labels & fields */
.form-label {
  font-size: 12px;
  line-height: 12px;
  letter-spacing: 0.4px;
  color: rgba(34, 51, 84, 0.5) !important;
  user-select: none;
}

.form-control,
.form-select,
textarea.form-control {
  width: 100%;
  padding: 8px 14px;
  letter-spacing: 0.09px;
  background: #ffffff;
  border: 1px solid rgba(34, 51, 84, 0.5) !important;
  border-radius: 4px !important;
  font-weight: 400;
  font-size: 14px;
  line-height: 24px;
  color: rgba(34, 51, 84, 0.5);
}

.form-control::placeholder {
  color: rgba(34, 51, 84, 0.35);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(34, 51, 84, 0.5) !important;
}

/* Make file input look closer to the rest of the fields */
input[type="file"].form-control {
  padding: 6px 14px;
}

input[type="file"].form-control::file-selector-button {
  margin-right: 12px;
  border: 1px solid rgba(34, 51, 84, 0.35);
  background: #F6F8FB;
  color: rgba(34, 51, 84, 0.65);
  border-radius: 4px;
  padding: 6px 10px;
}

input[type="file"].form-control::-webkit-file-upload-button {
  margin-right: 12px;
  border: 1px solid rgba(34, 51, 84, 0.35);
  background: #F6F8FB;
  color: rgba(34, 51, 84, 0.65);
  border-radius: 4px;
  padding: 6px 10px;
}

/* Use the old dropdown arrow (needs assets/images/down-arrow.svg) */
.form-select {
  cursor: pointer;
  background-image: url('../images/down-arrow.svg') !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 10px 5px !important;
  padding-right: 2.5rem;
}

/* Buttons */
.btn {
  border-radius: 4px !important;
  font-weight: 700;
}

.btn-lg {
  padding: 12px 30px;
}

.btn-primary {
  background: #007fba !important;
  border-color: #007fba !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #ffb101 !important;
  border-color: #ffb101 !important;
}

.btn-outline-primary {
  border-color: #007fba !important;
  color: #007fba !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: #007fba !important;
  border-color: #007fba !important;
  color: #ffffff !important;
}

/* Alerts: keep bootstrap layout, slightly closer to old tone */
.alert {
  border-radius: 4px;
}

.alert-success {
  background: #137fbf !important;
  border-color: #137fbf !important;
  color: #ffffff !important;
}

.alert-info {
  border: none !important;
  background: transparent !important;
  color: #9199AA !important;
  padding: 0 0 20px 0 !important;
}

.alert-info a {
  color: #007fba;
}

/* --------------------------------------------------------------------------
   Dynamic expense rows
   -------------------------------------------------------------------------- */

.expense-row {
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 30px;
}

.expense-row + .expense-row {
  margin-top: 0;
}

/* Space for the "PDF/JPG/PNG" helper text, which is positioned absolutely */
.expense-row-fields {
  margin-bottom: 18px;
}

.expense-receipt {
  position: relative;
}

.file-help {
  font-size: 11px;
  line-height: 13px;
  color: rgba(34, 51, 84, 0.5);
}

/* Keep the helper text visually attached to the receipt input without pushing
   the whole row down (so everything stays on one line). */
.expense-receipt .file-help {
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  margin: 0 !important;
}

.expense-remove-col {
  display: flex;
  align-items: flex-end;
}

.expense-remove-btn {
  white-space: nowrap;
  height: 42px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Signature pad
   -------------------------------------------------------------------------- */

.signature-pad {
  width: 100%;
  height: 85px;
  border: 1px solid rgba(34, 51, 84, 0.5);
  border-radius: 4px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  header .container,
  main.container,
  footer .container {
    padding-left: 35px !important;
    padding-right: 35px !important;
  }

  /* On small screens, keep the helper text in normal flow to avoid overlap. */
  .expense-row-fields {
    margin-bottom: 0;
  }

  .expense-receipt .file-help {
    position: static;
    margin-top: 6px !important;
  }

  .expense-remove-col {
    align-items: stretch;
  }

  .expense-remove-btn {
    width: 100%;
    height: auto;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Additions 2026-09: total, signature help, turnstile, validation
   -------------------------------------------------------------------------- */

.expense-total {
  border-top: 1px solid rgba(34, 51, 84, 0.2);
  padding-top: 12px;
  color: rgba(34, 51, 84, 0.8);
}

.form-text {
  font-size: 12px;
  color: rgba(34, 51, 84, 0.5);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545 !important;
}

.cf-turnstile {
  min-height: 65px;
}

.btn-primary:disabled {
  background: #007fba !important;
  border-color: #007fba !important;
  opacity: 0.75;
}
