/* ═══════════════════════════════════════════════════════════════════════
   TR24 – Formular-Styles
   Datei: assets/css/form.css
   Bearbeitung: Nur diese Datei ändern um das Formular neu zu gestalten
   Bearbeitung: Nur diese Datei ändern um das Formular neu zu gestalten
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── CSS-Variablen ── */
:root {
  --tr24-primary:        #0066CC;
  --tr24-primary-dark:   #004fa3;
  --tr24-primary-light:  #e8f0fb;
  --tr24-accent:         #FF6600;
  --tr24-success:        #28a745;
  --tr24-error:          #dc3545;
  --tr24-warning-bg:     #fff3cd;
  --tr24-text:           #1C1C1C;
  --tr24-text-light:     #666;
  --tr24-bg:             #ffffff;
  --tr24-bg-section:     #F8F9FA;
  --tr24-border:         #dce3ef;
  --tr24-border-focus:   #0066CC;
  --tr24-radius:         8px;
  --tr24-radius-sm:      4px;
  --tr24-font:           'Inter', 'Segoe UI', Arial, sans-serif;
  --tr24-shadow:         0 2px 12px rgba(0,102,204,.08);
  --tr24-shadow-hover:   0 4px 20px rgba(0,102,204,.16);
}

/* ─── Grundcontainer */
.tr24-wrap {
  max-width: 780px;
  margin: 0 auto;
  font-family: var(--tr24-font);
  color: var(--tr24-text);
}

/* ─── Titel */
.tr24-form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--tr24-primary);
  margin: 0 0 6px;
  text-align: center;
  padding: 16px 16px 0;
}
.tr24-form-subtitle {
  color: var(--tr24-text-light);
  margin: 0 0 24px;
  font-size: .95rem;
  text-align: center;
  padding: 0 16px;
}

/* ─── Formular */
.tr24-form {
  background: var(--tr24-bg);
  border-radius: var(--tr24-radius);
  box-shadow: var(--tr24-shadow);
  padding: 0;
  overflow: hidden;
}

/* ─── Fieldset */
.tr24-fieldset {
  display: block;
  margin: 0;
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--tr24-border);
  background: var(--tr24-bg);
  width: 100%;
  box-sizing: border-box;
}
.tr24-fieldset:last-of-type {
  border-bottom: none;
}
.tr24-fieldset:nth-child(even) {
  background: var(--tr24-bg-section);
}

/* ─── Legend (div) */
.tr24-legend {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tr24-primary);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 20px;
  padding: 0 0 8px;
  border-bottom: 2px solid var(--tr24-primary);
  width: 100%;
  display: block;
  box-sizing: border-box;
}

/* ─── Zeilen */
.tr24-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.tr24-row-2col > .tr24-field {
  flex: 1 1 calc(50% - 8px);
  min-width: 200px;
}
.tr24-row-3col > .tr24-field {
  flex: 1 1 calc(33% - 10px);
  min-width: 120px;
}
.tr24-row-3col > .tr24-col-2 {
  flex: 2 1 calc(67% - 10px);
}

/* ─── Felder */
.tr24-field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}
.tr24-row .tr24-field {
  margin-bottom: 0;
}
.tr24-row {
  margin-bottom: 18px;
}

/* ─── Label ── */
.tr24-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--tr24-text);
  margin-bottom: 6px;
}
.tr24-required {
  color: var(--tr24-error);
  margin-left: 2px;
}
.tr24-optional {
  color: var(--tr24-text-light);
  font-weight: 400;
  font-size: .82rem;
}

/* ─── Inputs */
.tr24-input,
.tr24-select,
.tr24-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: var(--tr24-font);
  color: var(--tr24-text);
  background: #fff;
  border: 1.5px solid var(--tr24-border);
  border-radius: var(--tr24-radius-sm);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.tr24-input:focus,
.tr24-select:focus,
.tr24-textarea:focus {
  border-color: var(--tr24-border-focus);
  box-shadow: 0 0 0 3px rgba(0,102,204,.15);
}
.tr24-input.tr24-invalid,
.tr24-select.tr24-invalid,
.tr24-textarea.tr24-invalid {
  border-color: var(--tr24-error);
  box-shadow: 0 0 0 3px rgba(220,53,69,.1);
}
.tr24-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.tr24-textarea {
  resize: vertical;
  min-height: 110px;
}

/* ─── Fehlermeldungen */
.tr24-field-error {
  font-size: .8rem;
  color: var(--tr24-error);
  margin-top: 4px;
  display: block;
  min-height: 1.1em;
}
.tr24-hint {
  font-size: .8rem;
  color: var(--tr24-text-light);
  margin-top: 4px;
}

/* ─── Datei-Upload */
.tr24-input-file {
  display: none;
}
.tr24-file-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tr24-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--tr24-primary-light);
  border: 1.5px solid var(--tr24-primary);
  color: var(--tr24-primary);
  border-radius: var(--tr24-radius-sm);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.tr24-file-label:hover {
  background: #d0e3f7;
}
.tr24-file-name {
  font-size: .85rem;
  color: var(--tr24-text-light);
}

/* ─── Checkbox */
.tr24-checkbox-field {
  padding: 20px 32px;
}
.tr24-checkbox-field + .tr24-checkbox-field {
  padding-top: 4px;
}
.tr24-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .88rem;
  color: var(--tr24-text-light);
  line-height: 1.5;
}
.tr24-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--tr24-primary);
  cursor: pointer;
}
.tr24-checkbox-label a {
  color: var(--tr24-primary);
}

/* ─── Absenden-Button */
.tr24-submit-row {
  padding: 20px 32px 28px;
  background: var(--tr24-bg-section);
  border-top: 1px solid var(--tr24-border);
}
.tr24-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 36px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--tr24-font);
  color: #fff;
  background: var(--tr24-primary);
  border: none;
  border-radius: var(--tr24-radius-sm);
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .1s;
  box-shadow: 0 3px 10px rgba(0,102,204,.3);
  letter-spacing: .02em;
}
.tr24-btn-submit:hover {
  background: var(--tr24-primary-dark);
  box-shadow: 0 5px 16px rgba(0,102,204,.4);
}
.tr24-btn-submit:active {
  transform: scale(.98);
}
.tr24-btn-submit:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}
.tr24-btn-spinner {
  display: inline-block;
  animation: tr24spin 1s linear infinite;
  font-size: 1.2rem;
}
@keyframes tr24spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─── Erfolgsmeldung */
.tr24-success-box {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1.5px solid #28a745;
  border-radius: var(--tr24-radius);
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: var(--tr24-shadow);
}
.tr24-success-icon {
  width: 60px;
  height: 60px;
  background: var(--tr24-success);
  color: #fff;
  font-size: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.tr24-success-box h3 {
  color: #155724;
  margin: 0 0 12px;
  font-size: 1.3rem;
}
.tr24-order-number-display {
  font-size: 1.1rem;
  color: #155724;
  margin: 0 0 12px;
}
.tr24-order-number-display strong {
  font-size: 1.4rem;
  letter-spacing: 2px;
  color: var(--tr24-primary);
}

/* ─── Fehlermeldung */
.tr24-error-box {
  background: #f8d7da;
  border: 1.5px solid var(--tr24-error);
  border-radius: var(--tr24-radius-sm);
  padding: 14px 18px;
  margin-bottom: 16px;
  color: #721c24;
  font-size: .92rem;
}

/* ─── Responsive */
@media (max-width: 600px) {
  .tr24-fieldset,
  .tr24-checkbox-field,
  .tr24-submit-row { padding: 20px 18px; }
  .tr24-row-2col > .tr24-field,
  .tr24-row-3col > .tr24-field { flex: 1 1 100%; }
}

/* ── Hinweis-Popup ── */
.tr24-hinweis-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.tr24-hinweis-box {
  background: #fff;
  border-radius: 10px;
  max-width: 560px;
  width: 100%;
  max-height: 82vh;          /* nie wyższy niż 82% ekranu */
  overflow-y: auto;          /* scrollowalny na małych ekranach */
  padding: 24px 24px 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  text-align: center;
}
.tr24-hinweis-icon {
  font-size: 2rem;
  color: #FF9900;
  margin-bottom: 8px;
  line-height: 1;
}
.tr24-hinweis-title {
  font-size: 1.1rem;
  color: #1a1a1a;
  margin: 0 0 12px;
}
.tr24-hinweis-body {
  font-size: .88rem;
  color: #444;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 14px;
}
.tr24-hinweis-body p { margin: 0 0 10px; }
.tr24-hinweis-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  color: #155724;
  font-weight: 600;
}
.tr24-hinweis-list li { padding: 3px 0; }
.tr24-hinweis-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e1;
  border: 1.5px solid #FF9900;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: .88rem;
  color: #333;
  cursor: pointer;
  text-align: left;
  margin-bottom: 18px;
}
.tr24-hinweis-check-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #0066CC;
  cursor: pointer;
}
.tr24-hinweis-btn {
  width: 100%;
  padding: 13px 20px;
  background: #0066CC;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.tr24-hinweis-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.tr24-hinweis-btn:not(:disabled):hover { background: #004fa3; }
