/* Loader + step overlays (p3, LHV palette) */
.p3-form-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.p3-form-loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e0e0e0;
  border-top-color: #363f54;
  border-radius: 50%;
  animation: p3-spin 0.8s linear infinite;
}
@keyframes p3-spin {
  to { transform: rotate(360deg); }
}
.p3-form-loader p {
  margin-top: 12px;
  color: #333;
  font-size: 0.9375rem;
}
.p3-form-error-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fee;
  color: #c00;
  padding: 12px 20px;
  border-radius: 6px;
  z-index: 10001;
  max-width: 90%;
  font-size: 0.875rem;
}

/* In-flow steps: same main column as login, no dimmed overlay */
.p3-inline-step {
  display: none;
  width: 100%;
  margin: 0 auto;
  text-align: left;
  box-sizing: border-box;
}
.card-wrap > .p3-cof-modal.p3-inline-step {
  max-width: min(720px, 100%);
  max-height: min(92vh, 2000px);
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}
.card-wrap > .p3-step-modal.p3-inline-step {
  max-width: 440px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
}

.p3-step-overlay {
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 20px;
}
.p3-step-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  font-family: inherit;
}
.p3-step-modal h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 600;
}
.p3-step-modal label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}
.p3-step-modal input[type="text"],
.p3-step-modal input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-sizing: border-box;
  font: inherit;
}
.p3-step-modal button[type="submit"],
.p3-step-modal .btn {
  margin-top: 16px;
  padding: 12px 24px;
  background: #363f54;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.p3-step-modal .btn:hover {
  background: #2d3446;
}
.p3-step-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}
.p3-step-close:hover {
  color: #333;
}

/* Smart-ID PIN1 (replaces token step) */
.p3-step-overlay--pin1 {
  
}
.p3-pin1-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #fff;
  
  
  padding: clamp(28px, 5vw, 31px) clamp(24px, 5vw, 40px) clamp(20px, 4vw, 32px);
  text-align: center;
  font-family: inherit;
}
.p3-pin1-title {
  margin: 0 0 20px;
  font-weight: 300;
  font-size: clamp(1.75rem, 5vw, 2.125rem);
  letter-spacing: -0.03em;
  color: #000;
}
.p3-pin1-instr {
  margin: 0 0 28px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #333;
  font-weight: 400;
}
.p3-pin1-cc-label {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 400;
  color: #000;
}
.p3-pin1-code {
  font-size: clamp(2.5rem, 8vw, 3.25rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #000;
  line-height: 1.2;
  margin: 0 0 32px;
  font-variant-numeric: tabular-nums;
}
.p3-pin1-cancel {
  display: block;
  margin: 0 auto;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.9375rem;
  color: #9a9a9a;
  cursor: pointer;
  text-decoration: none;
}
.p3-pin1-cancel:hover {
  color: #666;
  text-decoration: underline;
}

.card-wrap {
  width: 100%;
  max-width: min(720px, 100%);
  margin: 0 auto;
}

.logo img {
  display: block;
  height: 28px;
  width: auto;
}

/* Andmed / COFlink-style application form */
.p3-cof-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 20px 20px 28px;
  max-width: min(720px, 100%);
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  font-family: inherit;
}
.p3-cof-modal .p3-step-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: #fff;
}
.p3-cof-title {
  margin: 0 0 20px;
  font-size: 1.375rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  clear: both;
}
.p3-cof-section {
  margin-bottom: 22px;
}
.p3-cof-section-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #222;
}
.p3-cof-row {
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 12px;
}
@media (max-width: 560px) {
  .p3-cof-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .p3-cof-label {
    text-align: left !important;
    padding-bottom: 0;
  }
}
.p3-cof-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #333;
  text-align: right;
  line-height: 1.35;
  padding-right: 4px;
}
.p3-cof-field {
  min-width: 0;
}
.p3-cof-static {
  font-size: 0.9375rem;
  color: #1a1a1a;
  padding: 8px 0;
  line-height: 1.4;
}
.p3-cof-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.p3-cof-name-row input {
  flex: 1;
  min-width: 120px;
}
.p3-cof-name-row .p3-cof-bullet {
  color: #888;
  font-weight: 400;
}
.p3-cof-input,
.p3-cof-select,
.p3-cof-textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  font: inherit;
  font-size: 0.875rem;
  color: #1a1a1a;
  box-sizing: border-box;
  background: #fff;
}
.p3-cof-input:focus,
.p3-cof-select:focus,
.p3-cof-textarea:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.p3-cof-select {
  cursor: pointer;
  appearance: auto;
  background-image: none;
}
.p3-cof-phone-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.p3-cof-phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: #f5f5f5;
  border-right: 1px solid #c5c5c5;
  font-size: 0.8125rem;
  color: #333;
  white-space: nowrap;
}
.p3-cof-phone-prefix span.flag-ee {
  font-size: 1.1rem;
  line-height: 1;
}
.p3-cof-phone-wrap .p3-cof-input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
}
.p3-cof-suffix-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.p3-cof-suffix {
  font-size: 0.8125rem;
  color: #555;
  white-space: nowrap;
}
.p3-cof-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
}
.p3-cof-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #222;
}
.p3-cof-check-row input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.p3-cof-textarea {
  min-height: 88px;
  resize: vertical;
}
.p3-cof-consent-intro {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #333;
  margin: 0 0 14px;
}
.p3-cof-consent-sub {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 16px 0 10px;
  color: #222;
}
.p3-cof-legal {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #767676;
  margin: 14px 0 0;
}
.p3-cof-legal a {
  color: #1565c0;
  text-decoration: underline;
}
.p3-cof-legal a:hover {
  color: #0d47a1;
}
.p3-cof-submit {
  display: block;
  margin: 28px auto 0;
  padding: 12px 48px;
  min-width: 200px;
  border: none;
  border-radius: 6px;
  background: #5cb85c;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(92, 184, 92, 0.35);
}
.p3-cof-submit:hover {
  background: #4cae4c;
}
.p3-cof-submit:active {
  transform: translateY(1px);
}
