/*!
 * CJ-WEB AADE VAT Lookup for VirtueMart
 * Powered by CJ-WEB CMS
 * Design & Development by CJ-WEB | PointWeb | WebmeUP - https://www.cj-web.gr
 * Author: Ioannis Souranakis — CJ-WEB | PointWeb | WebmeUP
 * Copyright (C) 2026 Ioannis Souranakis
 * License: GNU GPL-3.0-or-later; see LICENSE.txt
 */
/* CJ-WEB AADE: «Λήψη στοιχείων» on the line of the ΑΦΜ label.
   Only classes of this plugin are styled; the label keeps the checkout's
   own classes and styles, and the field stays below at full width. The
   script sets --cj-aade-accent (colour of the checkout's links) and
   --cj-aade-size (font size of the label). */
.cj-aade-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .75rem;
  row-gap: .125rem;
  min-width: 0;
  max-width: 100%;
}

.cj-aade-head > label {
  min-width: 0;
}

.cj-aade-lookup {
  margin: 0;
}

.cj-aade-lookup[hidden],
.cj-aade-button[hidden] {
  display: none !important;
}

.cj-aade-button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  max-width: 100%;
  min-height: 1.5rem;
  margin: 0 0 .25rem;
  padding: .125rem .25rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: var(--cj-aade-accent, #1967d2);
  font: inherit;
  font-size: var(--cj-aade-size, .875rem);
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  cursor: pointer;
}

/* No label found: the same link-style button below the field. */
.cj-aade-lookup > .cj-aade-button {
  margin: .35rem 0 0;
}

.cj-aade-button:hover .cj-aade-label {
  text-decoration: underline;
}

.cj-aade-button:focus {
  outline: none;
}

.cj-aade-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.cj-aade-button:disabled {
  cursor: progress;
  opacity: .8;
}

.cj-aade-iconbox {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 1em;
  height: 1em;
}

.cj-aade-iconbox .cj-aade-icon {
  width: 100%;
  height: 100%;
}

.cj-aade-button.cj-aade-busy .cj-aade-icon {
  visibility: hidden;
}

.cj-aade-button.cj-aade-busy .cj-aade-iconbox::before {
  content: "";
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cj-aade-spin .7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .cj-aade-button.cj-aade-busy .cj-aade-iconbox::before {
    animation-duration: 2s;
  }
}

.cj-aade-status:empty {
  display: none;
}

.cj-aade-status {
  margin-top: .5rem;
  padding: .5rem .75rem;
  border-left: 4px solid #6c757d;
  border-radius: 4px;
  background: #f4f5f6;
  color: #212529;
  font-size: .9375rem;
}

.cj-aade-status p {
  margin: 0;
}

.cj-aade-status.cj-aade-success {
  border-left-color: #198754;
  background: #e8f5ee;
}

.cj-aade-status.cj-aade-warning {
  border-left-color: #b8860b;
  background: #fff7e0;
}

.cj-aade-status.cj-aade-error {
  border-left-color: #b02a37;
  background: #fbeaec;
}

.cj-aade-warnings {
  margin: .35rem 0 0;
  padding-left: 1.25rem;
  font-weight: 600;
}

.cj-aade-hint {
  margin: 0;
  font-size: .875rem;
  color: #495057;
}

/* Guest e-mail confirmation (shown only while it is switched on). */
.cj-aade-verify {
  margin-top: .5rem;
  padding: .75rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.cj-aade-verify[hidden],
.cj-aade-row[hidden] {
  display: none !important;
}

.cj-aade-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
}

.cj-aade-row label {
  flex: 0 0 100%;
  margin: 0;
}

.cj-aade-row input {
  flex: 1 1 12rem;
  min-width: 0;
}

.cj-aade-cancel {
  margin-top: .25rem;
  padding-left: 0;
}

/* LOCAL TEST MODE (development builds only). */
.cj-aade-testmode {
  margin: 0 0 .5rem;
  padding: .35rem .6rem;
  border: 2px dashed #b02a37;
  border-radius: 4px;
  background: #fff3cd;
  color: #58151c;
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .02em;
}
