body {
  font-family: Arial, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
  background-color: #f8f8f8;
  min-height: 100vh;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 99%;
  box-sizing: border-box;
}

h1 {
  color: #101b8b;
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.5rem;
  line-height: 1.2;
}

h3 {
  color: #333333bb;
  text-align: center;
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.2;
}

.form-group {
  margin-bottom: 10px;
}

.form-field {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.form-field label {
  width: 100%;
  margin-bottom: 5px;
  text-align: left;
}

.form-field input,
.form-field select {
  width: 100%;
}

.tbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tfill {
  flex: 1;
}

input[type="text"] {
  flex: 1;
}

label {
  display: block;
  color: #000000;
  font-size: 1rem;
  font-weight: bold;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  background-color: #ffffff;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

input:focus,
textarea:focus,
button:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

button {
  padding: 10px 16px;
  margin: 0;
  border: none;
  color: white;
  background-color: #007bff;
  line-height: 1em;
  text-align: center;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
  font-weight: 600;
  transition: background-color 0.3s ease;
  justify-content: center;
}
button:hover {
  background-color: #0056b3;
}
button:active {
  background-color: #004085;
  transform: scale(0.98);
}
.green-button {
  background-color: #4caf50;
}
.green-button:hover {
  background-color: #45a049;
}
.red-button {
  background-color: #f44336;
}
.red-button:hover {
  background-color: #e53935;
}
.blue-button {
  background-color: #007bff;
}
.blue-button:hover {
  background-color: #0056b3;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th,
td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: left;
}

img[alt="Uploaded Logo"],
#logoPreview {
  display: block;
  max-width: 100px;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#ibanresult {
  margin: 0;
}

#submit-toolbar {
  margin-top: 10px;
  margin-bottom: 20px;
}

/* Header styling */
.main-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 20px;
  padding: 10px 0;
  gap: 10px;
}

.main-header h1 {
  margin: 0;
  flex-grow: 1;
  text-align: right;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 12px;
  }

  h1 {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }

  label {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  input[type="text"],
  input[type="number"],
  textarea,
  button {
    padding: 10px;
    font-size: 0.95rem;
    border-radius: 6px;
  }
}

@media screen and (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }

  label {
    font-size: 0.9rem;
  }

  button {
    font-size: 0.9rem;
    padding: 8px;
  }

  textarea {
    min-height: 50px;
  }
}

/* For desktop/tablet (default): labels on left */
@media screen and (min-width: 500px) {
  .form-field {
    flex-direction: row;
    align-items: center;
  }

  .form-field label {
    width: 200px;
    margin-right: 15px;
    margin-bottom: 0;
    text-align: right;
  }

  .form-field input,
  .form-field select {
    flex: 1;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 1cm;
    background-color: #ccc;
  }

  body {
    margin: 0;
  }

  body {
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  #livePreview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
    margin: 0;
    border: none;
  }

  #livePreview table {
    width: 100%;
    border-collapse: collapse;
  }

  #livePreview table th,
  #livePreview table td {
    word-wrap: break-word;
  }

  * {
    page-break-after: avoid;
    page-break-before: avoid;
    page-break-inside: avoid;
  }

  .preview {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    padding: 0;
    box-shadow: none !important;
    border: none !important;
    background: white !important;
    border-radius: 0 !important;
  }

  button,
  input,
  textarea {
    display: none !important;
  }

  body * {
    visibility: hidden;
  }

  #livePreview,
  #livePreview * {
    visibility: visible !important;
  }

  #livePreview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }

  table,
  th,
  td {
    border-collapse: collapse !important;
    border: 1px solid #ccc !important;
  }

  .action-column,
  td:last-child {
    display: none !important;
  }
}

#livePreview {
  border: 1px solid #ccc;
  background: #ffffff;
  padding: 20px;
  margin-top: 20px;
  font-family: Arial, sans-serif;
}

#livePreview h2 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 20px;
}

#livePreview .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#livePreview .header .logo {
  width: 100px;
  height: auto;
}

#livePreview .header .church-info {
  font-size: 14px;
  text-align: left;
  font-weight: bold;
}

#livePreview table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

#livePreview table th,
#livePreview table td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

table th {
  background-color: #f4f4f4;
  font-weight: bold;
}
table tfoot td {
  font-weight: bold;
}

.approval-section {
  margin-top: 20px;
  justify-content: space-between;
  align-items: left;
}

.approval-section .stamp {
  width: 100px;
  height: auto;
}

.signature-section {
  text-align: right;
}

.approval-section {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.approval-section .text-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.approval-section .image-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.approval-section .stamp {
  width: 100px;
  height: auto;
}

.signature-section {
  text-align: right;
}

#signatureCanvas {
  width: 100%;
  max-width: 100%;
  height: 200px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.legal-footer {
  margin-top: 40px;
  font-family: Arial, sans-serif;
}

.legal-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.legal-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 45%;
}

.legal-column p {
  margin: 0 0 10px 0;
  font-weight: bold;
  text-align: center;
}

.stamp,
.signature {
  width: 100px; /* ajustează dimensiunea după nevoie */
  height: auto;
}

/* Stilizare pentru combobox-uri */
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #ffffff;
  color: #333;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns%3D%22http%3A//www.w3.org/2000/svg%22 viewBox%3D%220 0 4 5%22%3E%3Cpath fill%3D%22%23ccc%22 d%3D%22M2 0L0 2h4zm0 5L0 3h4z%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Stilizare pentru tableSection pentru a se potrivi cu containerul */
#tableSection,
#dateSection {
  padding: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 20px;
}
#tableSection h2,
#dateSection h2 {
  margin-top: 0;
  font-size: 1.2em;
  color: #101b8b;
}

input[type="date"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #333;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.5);
}

/* Stilizare pentru a face coloana de acțiuni să aibă dimensiune fixă */
.action-column {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
  padding: 0;
  text-align: center;
}

/* Stilizare buton de ștergere */
.remove-btn {
  cursor: pointer;
  color: #f44336;
  font-size: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  width: 25px;
  height: 25px;
  margin: 0 auto;
}

.remove-btn:hover {
  color: #d32f2f;
  transform: scale(1.2);
}

/* Specialized styling for IBAN elements */
.console-font {
  font-family: "Courier New", Consolas, Monaco, monospace;
  letter-spacing: 1px;
  font-weight: bold;
}

input.valid {
  border: 1px solid #4caf50 !important;
  background-color: #f0fff0 !important;
}
/* Apply same invalid styling for all invalid form elements */
input:invalid,
select:invalid,
textarea:invalid {
  border: 1px solid #f44336 !important;
  background-color: #fff0f0 !important;
}

/* Replace collapsible section styles with details/summary styles */
.details-section {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 15px;
  background-color: white;
  overflow: hidden;
}

.details-summary {
  padding: 10px 15px;
  background-color: #f5f5f5;
  transition: background-color 0.3s ease;
  cursor: pointer;
  list-style: none;
}

.details-summary::-webkit-details-marker {
  display: none;
}

.details-summary::after {
  content: "▼";
  float: right;
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

details[open] .details-summary::after {
  transform: rotate(180deg);
}

.details-summary:hover {
  background-color: #e9e9e9;
}

.details-summary h3 {
  display: inline;
  margin: 0;
  text-align: left;
  color: #101b8b;
  font-size: 1.1rem;
}

.details-content {
  padding: 15px;
}
