@charset "utf-8";

/*
 * css/signup-form-extras.css
 * Loaded after signup-styles.css. Adds the logo preview, error messages
 * and the sending state used by js/signup-form.js.
 * Colours follow the 3@1 brand tokens used in the email templates; change
 * the custom properties below if signup-styles.css defines its own.
 */
.signup-card {
  --sfx-navy: #001237;
  --sfx-gold: #D4B90E;
  --sfx-text: #1a2036;
  --sfx-muted: #6b7185;
  --sfx-line: #e3e6ed;
  --sfx-tile: #eef0f5;
  --sfx-error: #b42318;
  --sfx-error-bg: #fef3f2;
  --sfx-error-line: #f5c2bd;
}

/* Make sure the hidden attribute always wins over display rules */
.signup-card [hidden] {
  display: none !important;
}

/* Spam trap: kept off-screen, never shown to people */
.form-hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* ---------- Messages ---------- */
.form-alert {
  margin: 0 0 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--sfx-error-line);
  border-left: 4px solid var(--sfx-error);
  border-radius: 8px;
  background: var(--sfx-error-bg);
  color: var(--sfx-error);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.form-alert-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--sfx-error);
  line-height: 1.6;
}

.form-error {
  margin: 0.375rem 0 0;
  color: var(--sfx-error);
  font-size: 0.875rem;
  line-height: 1.4;
}

.form-group.has-error .form-control {
  border-color: var(--sfx-error);
}

.form-group.has-error .file-dropzone {
  outline: 2px solid var(--sfx-error);
  outline-offset: -2px;
}

/* ---------- Upload area while dragging ---------- */
.file-dropzone.is-dragover,
.file-preview.is-dragover {
  outline: 2px dashed var(--sfx-gold);
  outline-offset: -6px;
  background-color: rgba(212, 185, 14, 0.08);
}

.file-dropzone:focus-within {
  outline: 2px solid var(--sfx-gold);
  outline-offset: 2px;
}

/* ---------- Logo preview ---------- */
.file-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  border: 1px solid var(--sfx-line);
  border-radius: 12px;
  background: #fff;
}

.file-preview__thumb {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 96px;
  height: 96px;
  padding: 8px;
  border: 1px solid var(--sfx-line);
  border-radius: 8px;
  /* Chequered backdrop so white or transparent logos stay visible */
  background: repeating-conic-gradient(var(--sfx-tile) 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}

.file-preview__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-preview__meta {
  flex: 1 1 auto;
  min-width: 0;
}

.file-preview__name {
  margin: 0;
  overflow: hidden;
  color: var(--sfx-text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview__details {
  margin: 0.25rem 0 0;
  color: var(--sfx-muted);
  font-size: 0.875rem;
}

.file-preview__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.file-preview__btn {
  appearance: none;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--sfx-line);
  border-radius: 8px;
  background: #fff;
  color: var(--sfx-navy);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.file-preview__btn:hover {
  border-color: var(--sfx-navy);
}

.file-preview__btn:focus-visible {
  outline: 2px solid var(--sfx-gold);
  outline-offset: 2px;
}

.file-preview__btn--remove {
  color: var(--sfx-error);
}

.file-preview__btn--remove:hover {
  border-color: var(--sfx-error);
  background: var(--sfx-error-bg);
}

@media (max-width: 520px) {
  .file-preview {
    flex-wrap: wrap;
  }

  .file-preview__actions {
    width: 100%;
  }

  .file-preview__btn {
    flex: 1 1 0;
    padding: 0.625rem 0.5rem;
  }
}

/* ---------- Sending state ---------- */
.form-submit-btn[disabled] {
  opacity: 0.8;
  cursor: progress;
}

.form-submit-btn.is-loading .btn-icon {
  animation: sfx-arrow-nudge 0.9s ease-in-out infinite;
}

@keyframes sfx-arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(5px); }
}

/* ---------- Success card extras ---------- */
.success-card__title:focus {
  outline: none; /* focused by script only, so screen readers announce it */
}

.success-card__link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--sfx-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.success-card__link:focus-visible {
  outline: 2px solid var(--sfx-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .form-submit-btn.is-loading .btn-icon {
    animation: none;
  }

  .file-preview__btn {
    transition: none;
  }
}