/* =========================================================================
   jEDHOC — Vaadin 14 Application Theme
   Migrated from V7/V8 Valo-based SCSS theme
   ========================================================================= */

/* --- Brand colour overrides for Lumo ------------------------------------ */
html {
  --lumo-primary-color: #b10034;
  --lumo-primary-color-50pct: rgba(177, 0, 52, 0.5);
  --lumo-primary-color-10pct: rgba(177, 0, 52, 0.1);
  --lumo-primary-text-color: #b10034;
  --lumo-primary-contrast-color: #ffffff;

  --jedhoc-border-color: #c5c5c5;
  --jedhoc-border-radius: 4px;
  --jedhoc-tint: #b10034;
  --jedhoc-tint-hover: #bd0037;
  --jedhoc-tint-active: #a30030;
  --jedhoc-warning: #ed473b;
}

/* --- Global reset / font ------------------------------------------------ */
body {
  font-family: var(--lumo-font-family);
  color: var(--lumo-body-text-color);
}

/* =========================================================================
   Layout
   ========================================================================= */

/* Main header bar */
.main-header {
  background: #ffffff;
  border-bottom: 1px solid var(--jedhoc-border-color);
  padding: 4px 16px;
}

/* Application brand name in header */
.app-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--lumo-primary-color);
  margin-right: 12px;
  white-space: nowrap;
}

#usernameLabel {
  margin-top: 5px;
}

/* Admin user-switch state: highlight the header bar */
.userChange .main-header {
  background: #fff3cd;
  border-bottom-color: #ffc107;
}

/* Copyright footer */
#copyrightFooter {
  text-align: center;
  padding: 10px 0;
  font-size: 10px;
  color: var(--lumo-secondary-text-color);
}

/* Inner page content area */
#viewContainer {
  padding: 20px;
}

/* Tab / view content wrapper */
.tab-content {
  padding: 16px;
}

/* Borderless panel (system-parameter view) */
.panel-borderless {
  --lumo-contrast-5pct: transparent;
  border: none;
  box-shadow: none;
}

/* Horizontal button rows */
.horizontalButtonLayout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   Utility classes
   ========================================================================= */

/* Force lowercase input */
.lower-case input {
  text-transform: lowercase;
}

/* Warning text (e.g. expiry date) */
.warning-color {
  font-weight: bold;
  color: var(--jedhoc-warning);
}

/* Error labels (mail-server not configured, etc.) */
.error-label {
  color: var(--lumo-error-color);
  font-weight: 500;
}

/* Failure text (mail-server info in upload view) */
.failure {
  color: var(--lumo-error-color);
  font-weight: 500;
}

/* Green icon buttons */
.greenicon {
  color: #2e7d32 !important;
}

/* Small filter-row inputs inside grids */
.tiny {
  font-size: 12px;
}

/* =========================================================================
   Login view
   ========================================================================= */

.login-panel {
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
  padding: 20px 10px;
}

/* =========================================================================
   Setup UI
   ========================================================================= */

.setupForm {
  padding: 24px;
}

.logo-text {
  font-size: 24px;
  font-weight: bold;
  color: var(--jedhoc-tint);
}

.fieldsLayout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =========================================================================
   Download / Upload / Voucher external pages
   ========================================================================= */

.warning {
  color: var(--lumo-error-color);
  font-weight: 500;
  padding: 16px;
}

.download {
  padding: 16px;
}

.voucher {
  max-width: 600px;
  padding: 16px;
}

/* Upload comment field */
#upload-comment {
  max-width: 387px;
  width: 100%;
}

/* Upload progress bar container */
#uploadProgress {
  width: 100%;
  max-width: 100%;
}

#uploadProgressLayout {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 387px;
  gap: 8px;
}

#uploadProgressText {
  font-size: 13px;
  color: var(--lumo-secondary-text-color);
}

#maxFileSizeLabel {
  margin-top: -5px;
  font-size: 13px;
  color: var(--lumo-secondary-text-color);
}

#cancel-upload-button {
  background-color: transparent;
  border: none;
  padding: 0;
  color: #464646;
  cursor: pointer;
}

/* =========================================================================
   User management view
   ========================================================================= */

.userViewTextInput {
  width: 350px;
}

.userViewPasswordInput {
  width: 350px;
}

/* =========================================================================
   Token field
   ========================================================================= */

.tokenfield {
  max-width: 500px;
  width: 100%;
  display: block;
}

.token-button {
  margin: 0 2px 2px 0;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--jedhoc-border-radius);
}

/* =========================================================================
   Domain / Company view
   ========================================================================= */

.domainDetailElement {
  margin-left: 25px;
}

.addrLayout {
  background-color: #ffffff;
  border: 1px solid var(--jedhoc-border-color);
  border-radius: var(--jedhoc-border-radius);
  padding: 15px 15px 0;
}

/* "Add address" section — dashed border to distinguish from existing addresses */
.addAddrLayout {
  border-style: dashed;
  background-color: var(--lumo-primary-color-10pct);
}

.marginLayout {
  padding: 25px;
}

/* =========================================================================
   Logo / branding
   ========================================================================= */

#logoEmbedded {
  border: 1px solid var(--jedhoc-border-color);
  padding: 20px;
  margin-right: 14px;
  border-radius: var(--jedhoc-border-radius);
}

#logoEmbedded img {
  display: block;
  max-width: 100%;
  width: auto !important;
}

/* =========================================================================
   InfoLabel component
   ========================================================================= */

.infolabel-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

.infolabel {
  font-size: 12px;
  color: var(--lumo-secondary-text-color);
}

/* =========================================================================
   Responsive breakpoints
   ========================================================================= */

@media only screen and (max-width: 650px) {
  #viewContainer {
    padding: 10px;
  }

  .horizontalButtonLayout {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media only screen and (max-width: 450px) {
  .tokenfield {
    max-width: 100%;
  }

  .userViewTextInput,
  .userViewPasswordInput {
    width: 100%;
  }
}
