/**
 * Support – Already paid
 * /support/already-paid
 */

.page-already-paid {
  background: #ffffff;
  overflow-x: hidden;
}

.already-paid {
  padding-bottom: 80px;
  width: 100%;
  max-width: 100%;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.already-paid__hero {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  padding: 28px 0 12px;
}

.already-paid__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../../../assets/images/home/support-hero.png");
  background-size: cover;
  background-position: 82% 18%;
  background-repeat: no-repeat;
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
}

.already-paid__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 0.98) 42%,
    rgba(255, 255, 255, 0.72) 62%,
    rgba(255, 255, 255, 0.2) 80%,
    rgba(255, 255, 255, 0) 92%
  );
  z-index: 1;
  pointer-events: none;
}

.already-paid__hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
}

.already-paid__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  transition: color 0.2s ease;
}

.already-paid__back:hover {
  color: var(--color-primary);
}

.already-paid__intro {
  max-width: 680px;
  padding-bottom: 24px;
}

.already-paid__title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.already-paid__title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--color-green);
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(103, 194, 58, 0.28);
}

.already-paid__title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #111827;
}

.already-paid__lead {
  margin: 0;
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.7;
  color: #6b7280;
}

.already-paid__body {
  max-width: 1200px;
  width: 100%;
  padding-top: 28px;
  padding-bottom: 28px;
}

/* ==========================================================================
   Main 3-step flow
   ========================================================================== */
.ap-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
}

.ap-flow__connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-green);
  padding: 0;
  align-self: stretch;
}

.ap-flow__line {
  width: 2px;
  flex: 1;
  max-height: 48px;
  background: linear-gradient(180deg, transparent, rgba(103, 194, 58, 0.35), transparent);
}

.ap-flow__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef9e8;
  color: var(--color-green);
  box-shadow: 0 4px 10px rgba(103, 194, 58, 0.15);
}

.ap-step {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  padding: 26px 24px;
  background: #ffffff;
  border: 1px solid #e8ecf1;
  border-radius: 20px;
  box-shadow:
    0 1px 2px rgba(16, 40, 75, 0.03),
    0 12px 30px rgba(16, 40, 75, 0.05);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease,
    opacity 0.25s ease;
}

.ap-step.is-active {
  border-color: rgba(103, 194, 58, 0.35);
  box-shadow:
    0 8px 20px rgba(103, 194, 58, 0.08),
    0 16px 36px rgba(16, 40, 75, 0.08);
  transform: translateY(-2px);
}

.ap-step.is-complete {
  border-color: rgba(103, 194, 58, 0.22);
}

.ap-step.is-upcoming {
  opacity: 0.72;
}

.ap-step.is-upcoming .ap-step__btn {
  pointer-events: none;
  opacity: 0.55;
}

.ap-step.is-locked {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.08);
  user-select: none;
}

.ap-dropzone.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.ap-step__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.ap-step__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  background: var(--color-green);
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(103, 194, 58, 0.25);
}

.ap-step.is-complete .ap-step__badge {
  background: var(--color-green-dark);
}

.ap-step__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #111827;
}

.ap-step__text {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #6b7280;
}

.ap-step__btn {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  gap: 8px;
  margin: 0;
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ap-step__actions {
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
}

.ap-step__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ap-step__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(103, 194, 58, 0.28);
}

.ap-step__secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #f0f3f7;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #6b7280;
}

.ap-step__secure svg {
  color: var(--color-green);
  flex-shrink: 0;
}

/* Step 1 form */
.ap-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.ap-form__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.ap-form__info {
  display: inline-flex;
  color: #9ca3af;
}

.ap-form__input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid #dbe1ea;
  border-radius: 14px;
  font: inherit;
  font-size: 0.9375rem;
  color: #111827;
  background: #fafbfc;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ap-form__input::placeholder {
  color: #9ca3af;
}

.ap-form__input:focus {
  outline: none;
  background: #ffffff;
  border-color: rgba(103, 194, 58, 0.7);
  box-shadow: 0 0 0 4px rgba(103, 194, 58, 0.14);
}

.ap-form__input.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.12);
}

.ap-form__error {
  margin: 0;
  font-size: 0.8125rem;
  color: #dc2626;
}

.ap-form__success {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: #15803d;
  line-height: 1.45;
}

/* ==========================================================================
   Toasts (top-right)
   ========================================================================== */
.ap-toast-host {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.ap-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 14px 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.ap-toast.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.ap-toast__text {
  margin: 0;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #111827;
}

.ap-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.ap-toast__close:hover {
  background: #f3f4f6;
  color: #111827;
}

.ap-toast--success {
  border-color: rgba(103, 194, 58, 0.45);
  border-left: 4px solid var(--color-green, #67c23a);
}

.ap-toast--error {
  border-color: rgba(239, 68, 68, 0.35);
  border-left: 4px solid #ef4444;
}

.ap-toast--info {
  border-color: rgba(30, 58, 95, 0.25);
  border-left: 4px solid #1e3a5f;
}

@media (max-width: 640px) {
  .ap-toast-host {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* Step 2 overview – receipt style */
.ap-overview {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(103, 194, 58, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.ap-overview__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #eef9e8 0%, #f7fcf4 100%);
  border-bottom: 1px dashed rgba(103, 194, 58, 0.25);
}

.ap-overview__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-green-dark);
}

.ap-overview__status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-green-dark);
  background: rgba(103, 194, 58, 0.16);
}

.ap-overview__amount {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 10px;
  background: #fbfdf9;
}

.ap-overview__amount-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.ap-overview__amount-value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}

.ap-overview__list {
  margin: 0;
  padding: 4px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ap-overview__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid #eef2f6;
}

.ap-overview__row dt {
  font-size: 0.8125rem;
  color: #6b7280;
}

.ap-overview__row dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  text-align: right;
}

/* Step 3 upload */
.ap-upload {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 14px;
  width: 100%;
  min-height: 0;
}

.ap-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 140px;
  padding: 24px 16px;
  border: 1.5px dashed rgba(103, 194, 58, 0.45);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(248, 252, 246, 0.9), rgba(243, 250, 240, 0.95));
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ap-dropzone:hover,
.ap-dropzone.is-dragover {
  border-color: var(--color-green);
  background: #eef9e8;
  box-shadow: inset 0 0 0 1px rgba(103, 194, 58, 0.14);
  transform: translateY(-1px);
}

.ap-dropzone__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--color-green);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 40, 75, 0.08);
}

.ap-dropzone__title {
  font-size: 0.925rem;
  font-weight: 700;
  color: #111827;
}

.ap-dropzone__hint {
  max-width: 240px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #6b7280;
}

.ap-dropzone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ap-files__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.ap-files__label {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
}

.ap-files__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-green-dark);
  background: #eef9e8;
  padding: 3px 8px;
  border-radius: 999px;
}

.ap-files__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e8ecf1;
  box-shadow: 0 2px 8px rgba(16, 40, 75, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ap-file:hover {
  border-color: #d7dee8;
  box-shadow: 0 4px 12px rgba(16, 40, 75, 0.06);
}

.ap-file__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: #c2410c;
  background: linear-gradient(160deg, #fff7ed, #ffedd5);
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.ap-file__meta {
  min-width: 0;
  flex: 1;
}

.ap-file__name {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-file__size {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: #6b7280;
}

.ap-file__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #f8fafc;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.ap-file__remove:hover {
  color: #dc2626;
  background: #fef2f2;
}

/* ==========================================================================
   What happens next
   ========================================================================== */
.ap-next {
  margin-top: 36px;
  padding-top: 8px;
}

.ap-next__title {
  margin: 0 0 20px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111827;
}

.ap-next__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
}

.ap-next__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-green);
  opacity: 0.75;
}

.ap-next__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 100%;
  padding: 22px 18px;
  background: #ffffff;
  border: 1px solid #e8ecf1;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(16, 40, 75, 0.04);
}

.ap-next__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--color-green);
  background: #eef9e8;
}

.ap-next__card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111827;
}

.ap-next__card-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #6b7280;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
  .ap-flow {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  }

  .ap-step {
    padding: 22px 18px;
  }

  .ap-step__title {
    font-size: 1rem;
  }

  .ap-overview__amount-value {
    font-size: 1.2rem;
  }
}

@media (max-width: 1024px) {
  .ap-flow {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .ap-flow__connector {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
    min-height: 28px;
  }

  .ap-flow__line {
    width: auto;
    height: 2px;
    max-height: none;
    flex: 1;
    max-width: 72px;
    background: linear-gradient(90deg, transparent, rgba(103, 194, 58, 0.4), transparent);
  }

  .ap-flow__chevron {
    transform: rotate(90deg);
    flex-shrink: 0;
  }

  .ap-step.is-upcoming {
    opacity: 1;
  }

  .ap-step.is-upcoming .ap-step__btn {
    pointer-events: auto;
    opacity: 1;
  }

  .ap-step.is-locked,
  .ap-step.is-locked.is-upcoming {
    opacity: 0.55;
    pointer-events: none;
  }

  .ap-step.is-locked .ap-step__btn {
    pointer-events: none;
    opacity: 0.55;
  }

  .ap-step.is-active {
    transform: none;
  }

  .ap-next__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .ap-next__arrow {
    display: none;
  }
}

@media (max-width: 768px) {
  .already-paid {
    padding-bottom: 56px;
  }

  .already-paid__hero {
    padding: 20px 0 8px;
  }

  .already-paid__hero::after {
    background-position: 70% 30%;
    opacity: 0.55;
  }

  .already-paid__hero::before {
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(255, 255, 255, 0.94) 55%,
      rgba(255, 255, 255, 0.88) 100%
    );
  }

  .already-paid__back {
    margin-bottom: 20px;
    min-height: 44px;
  }

  .already-paid__intro {
    padding-bottom: 16px;
  }

  .already-paid__title-row {
    align-items: flex-start;
    gap: 12px;
  }

  .already-paid__title-icon {
    width: 42px;
    height: 42px;
  }

  .already-paid__title {
    font-size: clamp(1.45rem, 6vw, 1.75rem);
  }

  .already-paid__lead {
    font-size: 0.95rem;
  }

  .ap-step {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .ap-step__head {
    gap: 10px;
  }

  .ap-step__badge {
    width: 28px;
    height: 28px;
    font-size: 0.8125rem;
  }

  .ap-step__btn {
    min-height: 48px;
  }

  .ap-form__input {
    height: 48px;
    font-size: 1rem; /* prevents iOS zoom */
  }

  .ap-dropzone {
    min-height: 124px;
    padding: 20px 14px;
  }

  .already-paid__body {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .ap-step__actions {
    margin-top: auto;
    padding-top: 14px;
  }

  .ap-next {
    margin-top: 28px;
  }

  .ap-next__title {
    font-size: 1.125rem;
    margin-bottom: 16px;
  }

  .ap-next__card {
    padding: 18px 16px;
  }
}

@media (max-width: 560px) {
  .already-paid__title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ap-flow__connector {
    min-height: 24px;
  }

  .ap-flow__line {
    max-width: 48px;
  }

  .ap-flow__chevron {
    width: 30px;
    height: 30px;
  }

  .ap-overview__amount-value {
    font-size: 1.25rem;
  }

  .ap-overview__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .ap-overview__row dd {
    text-align: left;
  }

  .ap-files__head {
    flex-wrap: wrap;
  }

  .ap-file {
    padding: 10px;
    gap: 10px;
  }

  .ap-file__icon {
    width: 36px;
    height: 36px;
  }

  .ap-file__remove {
    width: 40px;
    height: 40px;
  }

  .ap-next__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 375px) {
  .ap-step {
    padding: 18px 14px;
  }

  .ap-step__title {
    font-size: 0.95rem;
  }

  .ap-step__text,
  .ap-overview__row dt,
  .ap-dropzone__hint {
    font-size: 0.8125rem;
  }

  .ap-overview__amount-value {
    font-size: 1.15rem;
  }

  .ap-dropzone__title {
    font-size: 0.875rem;
  }
}
