/*
  The registration site's look - the former Static Web App's base.css + form.css, same class names, so the Blazor app
  keeps the SWA's layout. What changed: the SWA styled raw <input>/<select>/<label>/checkboxes; here the inputs are
  MudBlazor components, so those rules became the overrides at the bottom (scoped to .tu-field / .tu-question).
  Fonts are loaded in App.razor.
*/

:root {
  --tu-green: #10A452;
  --tu-ink:   #060606;
  --tu-white: #FFFFFF;

  --tu-mint:  #8CD7AE;
  --tu-leaf:  #41AF69;
  --tu-grey:  #878787;
  --tu-slate: #152930;
  --tu-navy:  #09222D;

  --tu-error:   #cc3333;
  --tu-warning: #e8a020;

  --tu-font-title: 'Montserrat', Arial, Helvetica, sans-serif;
  --tu-font-body:  'Open Sans', Arial, Helvetica, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

.tu-wrap :where(h1, h2, h3, p) {
  margin: 0;
}

body {
  font-family: var(--tu-font-body);
  background: #f2f2f2;
  color: var(--tu-ink);
}

h1:focus {
  outline: none;
}

/* ---- page chrome (base.css) ------------------------------------------------------------------------------------ */

.tu-wrap {
  padding: 0 0 3rem;
  min-height: 100vh;
}

.tu-header {
  background: var(--tu-ink);
  padding: 14px 2rem;
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.tu-logo {
  height: 40px;
  display: block;
}

.tu-logo-fallback {
  display: none;
  color: var(--tu-white);
  font-family: var(--tu-font-title);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tu-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--tu-white);
}

.tu-header-user {
  font-size: 12px;
  color: #cfcfcf;
  margin-right: 4px;
}

.tu-header-form {
  display: inline-flex;
  margin: 0;
}

.tu-language-current {
  font-weight: 700;
}

.tu-card {
  background: var(--tu-white);
  border-radius: 2px;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.tu-card-header {
  background: var(--tu-ink);
  padding: 1.25rem 2rem;
  border-left: 4px solid var(--tu-green);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tu-card-header h1 {
  color: var(--tu-white);
  font-family: var(--tu-font-title);
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.tu-card-header span {
  color: var(--tu-grey);
  font-size: 12px;
  white-space: nowrap;
  margin-left: 1rem;
}

.tu-card-body {
  padding: 1.75rem 2rem;
  min-height: 300px;
  font-size: 14px;
  line-height: 1.6;
}

.tu-card-body > p + p {
  margin-top: 0.75rem;
}

.tu-success {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  font-size: 0;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.tu-success h2 {
  color: var(--tu-ink);
  font-family: var(--tu-font-title);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.tu-success p {
  color: #666;
  font-size: 14px;
  line-height: 1.7;
}

.tu-tagline {
  text-align: center;
  font-family: var(--tu-font-title);
  font-size: 11px;
  color: #999;
  margin: 1.25rem 0 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tu-footer-address {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #999;
  margin-top: 1rem;
  text-align: center;
  letter-spacing: 0.03em;
}

.tu-contact-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.4rem;
}

.tu-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #999;
  letter-spacing: 0.03em;
}

.tu-contact-icon {
  display: flex;
  align-items: center;
}

.tu-contact-separator {
  color: #ccc;
}

.tu-contact-link {
  color: #999;
  text-decoration: none;
}

/* ---- splash + truck loader (base.css) -------------------------------------------------------------------------- */

#splash {
  position: fixed;
  inset: 0;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 1s ease;
}

#splash.splash-hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  transform: scale(2);
  transform-origin: center;
}

.splash-text {
  font-family: var(--tu-font-title);
  font-size: 12px;
  color: var(--tu-grey);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  max-width: 280px;
  text-align: center;
}

.splash-result {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader {
  width: fit-content;
  height: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
}
.truckWrapper {
  width: 200px;
  height: 100px;
  display: flex;
  flex-direction: column;
  position: relative;
  align-items: center;
  justify-content: flex-end;
  overflow-x: hidden;
}
.truckBody {
  width: 130px;
  height: fit-content;
  margin-bottom: 6px;
  position: relative;
  animation: truck-motion 1s linear infinite;
}
.truck-logo {
  position: absolute;
  left: 10px;
  top: 12px;
  width: 70px;
  height: auto;
  pointer-events: none;
}
@keyframes truck-motion {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(3px); }
  100% { transform: translateY(0px); }
}
.truckTires {
  width: 130px;
  height: fit-content;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 10px 0px 15px;
  position: absolute;
  bottom: 0;
}
.truckTires svg {
  width: 24px;
}
.road {
  width: 100%;
  height: 1.5px;
  background-color: #282828;
  position: relative;
  bottom: 0;
  align-self: flex-end;
  border-radius: 3px;
}
.road::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 100%;
  background-color: #282828;
  right: -50%;
  border-radius: 3px;
  animation: truck-road 1.4s linear infinite;
  border-left: 10px solid #f2f2f2;
}
.road::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 100%;
  background-color: #282828;
  right: -65%;
  border-radius: 3px;
  animation: truck-road 1.4s linear infinite;
  border-left: 4px solid #f2f2f2;
}
.lampPost {
  position: absolute;
  bottom: 0;
  right: -90%;
  height: 90px;
  animation: truck-road 1.4s linear infinite;
}
@keyframes truck-road {
  0%   { transform: translateX(0px); }
  100% { transform: translateX(-350px); }
}

/* ---- wizard (form.css) ----------------------------------------------------------------------------------------- */

.tu-progress {
  max-width: 640px;
  margin: 0 auto 1.25rem;
  padding: 0 1rem;
}

.tu-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
}

.tu-steps::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #ddd;
  z-index: 0;
}

.tu-progress-fill {
  position: absolute;
  top: 16px;
  left: 16px;
  height: 2px;
  background: var(--tu-green);
  z-index: 1;
  transition: width 0.4s ease;
  width: 0%;
  max-width: calc(100% - 32px); /* stop at the last circle (the SWA ran past it at 100%) */
}

.tu-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.tu-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ddd;
  color: #888;
  font-family: var(--tu-font-title);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ddd;
  transition: all 0.3s;
  flex-shrink: 0;
}

.tu-step-circle.active {
  background: var(--tu-ink);
  border-color: var(--tu-green);
  color: var(--tu-white);
}

.tu-step-circle.done {
  background: var(--tu-green);
  border-color: var(--tu-green);
  color: var(--tu-white);
}

.tu-step-label {
  font-family: var(--tu-font-body);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #aaa;
  text-align: center;
  max-width: 64px;
  line-height: 1.3;
  transition: color 0.3s;
}

.tu-step-label.active { color: var(--tu-ink); }
.tu-step-label.done   { color: var(--tu-green); }

.tu-section-label {
  font-family: var(--tu-font-title);
  font-size: 11px;
  font-weight: 700;
  color: var(--tu-ink);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--tu-green);
  padding-bottom: 6px;
  margin: 1.25rem 0 1rem !important;
}

.tu-section-label:first-child {
  margin-top: 0 !important;
}

.tu-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tu-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.span-2 {
  grid-column: span 2;
}

.tu-field {
  margin-bottom: 14px;
}

.tu-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--tu-grey);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.tu-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #aaa;
  font-size: 11px;
}

.req { color: var(--tu-green); }

.hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 3px;
  line-height: 1.4;
}

.hint.error {
  color: var(--tu-error);
  font-weight: 600;
}

.tu-phone-wrapper {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}

.vat-msg {
  font-size: 11px;
  margin-top: 3px;
  font-weight: 600;
}

.vat-msg.valid    { color: var(--tu-green); }
.vat-msg.invalid  { color: var(--tu-error); }
.vat-msg.checking { color: var(--tu-grey); }
.vat-msg.warning  { color: var(--tu-warning); }

.tu-note {
  margin-top: 0.75rem;
}

.tu-note-title {
  display: block;
  color: var(--tu-warning);
  font-weight: 700;
  margin-bottom: 4px;
}

.tu-footer {
  padding: 1.25rem 2rem;
  background: #f7f7f7;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.tu-footer-note {
  font-size: 12px;
  color: #888;
  text-align: center;
}

.summary-group {
  margin-bottom: 1.25rem;
}

.summary-group-title {
  font-family: var(--tu-font-title);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tu-green);
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #f5f5f5;
  gap: 1rem;
}

.summary-row span:first-child {
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-row span:last-child {
  color: var(--tu-ink);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.tu-pdf-email {
  margin-top: 4px;
}

/* VIES prefill / overwrite */

.tu-vies-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #eefaf1;
  border: 1px solid var(--tu-mint);
  border-radius: 2px;
  padding: 8px 12px;
  margin: 8px 0 14px;
  font-size: 12px;
  color: var(--tu-leaf);
}

.tu-vies-banner.tu-vies-banner-overwritten {
  background: #fff8ec;
  border-color: var(--tu-warning);
  color: var(--tu-warning);
}

.tu-vies-banner-text { flex: 1; }

.mud-button-root.tu-btn-overwrite {
  background: var(--tu-white);
  color: var(--tu-ink);
  border: 1px solid #ccc;
  padding: 4px 12px;
  font-size: 10px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.mud-button-root.tu-btn-overwrite:hover { background: #f0f0f0; }

.tu-retry-vat {
  margin-top: 6px;
}

.tu-modal-title {
  font-family: var(--tu-font-title);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tu-ink);
}

.tu-modal-text {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin: 0 0 14px;
}

.summary-vies-note {
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 12px;
  background: #eefaf1;
  color: var(--tu-leaf);
  border: 1px solid var(--tu-mint);
}

.summary-vies-note.summary-vies-overwritten {
  background: #fff8ec;
  color: var(--tu-warning);
  border-color: var(--tu-warning);
}

/* ---- internal creation request form ---------------------------------------------------------------------------- */

.tu-intro {
  font-size: 13px;
  color: #555;
}

.tu-card-body > .tu-intro:last-of-type {
  margin-bottom: 1.5rem;
}

.tu-question {
  margin-bottom: 22px;
}

.tu-question-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--tu-ink);
  margin: 0 0 4px !important;
  line-height: 1.4;
}

.tu-question-help {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin: 0 0 8px !important;
}

ul.tu-question-help {
  padding-left: 18px;
}

.tu-other-text {
  margin-top: 6px;
}

.tu-env-label {
  font-family: var(--tu-font-title);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tu-warning) !important;
}

/* ---- MudBlazor inputs with the SWA's flat look ----------------------------------------------------------------- */

:is(.tu-field, .tu-question, .tu-modal) .mud-input.mud-input-outlined {
  background: #fafafa;
  font-family: var(--tu-font-body);
  font-size: 13px;
  transition: background 0.2s;
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input.mud-input-outlined:focus-within {
  background: var(--tu-white);
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input.mud-input-outlined .mud-input-outlined-border {
  border-color: #ccc;
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input.mud-input-outlined:focus-within > .mud-input-outlined-border {
  border-width: 1px;
  border-color: var(--tu-green);
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input-root-outlined,
:is(.tu-field, .tu-question, .tu-modal) div.mud-input-slot.mud-input-root-outlined {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--tu-ink);
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input > :is(input, textarea).mud-input-root::placeholder {
  color: #bbb;
  opacity: 1;
}

/* Invalid: red border and a light red background - the text itself stays ink (MudBlazor would turn it red). */
:is(.tu-field, .tu-question, .tu-modal) .mud-input.mud-input-error {
  background: #fff8f8;
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input.mud-input-error .mud-input-root {
  color: var(--tu-ink) !important;
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input-control-helper-container {
  margin-top: 3px;
}

:is(.tu-field, .tu-question, .tu-modal) .mud-input-helper-text {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

/* Messages start at the input's left edge, like the SWA's hints (MudBlazor indents them for outlined inputs). */
:is(.tu-field, .tu-question, .tu-modal) .mud-input-helper-text.mud-input-helper-text-contained {
  margin-left: 0;
  margin-right: 0;
}

.tu-input-valid .mud-input.mud-input-outlined .mud-input-outlined-border {
  border-color: var(--tu-green) !important;
}

/* VIES-verified and locked. */
.tu-locked .mud-input.mud-input-outlined {
  background: #f0f0f0 !important;
  cursor: not-allowed;
}

.tu-locked .mud-input-root {
  color: #666 !important;
  cursor: not-allowed;
}

.tu-vat-checking .mud-input-adornment svg {
  animation: tu-spin 1s linear infinite;
}

@keyframes tu-spin {
  to { transform: rotate(360deg); }
}

.tu-checkbox .mud-typography,
.tu-radio .mud-typography,
.tu-radio {
  font-size: 13px;
  color: #444;
}

/* One option per line, like the MS Form (MudBlazor lays a radio group out as a wrapping row). */
.tu-question .mud-input-control.mud-input-control-boolean-input .mud-radio-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Buttons: the SWA's flat, uppercase Montserrat buttons. */
.mud-button-root.tu-btn {
  padding: 10px 22px;
  font-size: 12px;
  letter-spacing: 0.06em;
  box-shadow: none;
  min-width: 0;
}

.mud-button-root.tu-btn:hover {
  box-shadow: none;
}

.mud-button-filled.tu-btn:not(.mud-button-filled-primary):not(.mud-button-filled-dark) {
  background: #e0e0e0;
  color: #444;
}

.mud-button-filled.tu-btn:not(.mud-button-filled-primary):not(.mud-button-filled-dark):hover {
  background: #ccc;
}

/* ---- small screens --------------------------------------------------------------------------------------------- */

@media (max-width: 600px) {
  .tu-header      { padding: 14px 1rem; }
  .tu-card-body   { padding: 1.25rem 1rem; }
  .tu-card-header { padding: 1rem; }
  .tu-footer      { padding: 1rem; }
  .tu-grid-2,
  .tu-grid-3      { grid-template-columns: 1fr; }
  .span-2         { grid-column: span 1; }
  .tu-step-label  { display: none; }
  .tu-footer-note { display: none; }
  .tu-header-user { display: none; }
}

/* ---- Blazor's error boundary (template) ------------------------------------------------------------------------ */

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}

.blazor-error-boundary::after {
  content: "An error has occurred.";
}
