// Variables
@import './modules/variables';

// Breakpoints
$tablet: 768px;
$mobile: 480px;

// Mixins
@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

@mixin flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@mixin input-style {
  width: 100%;
  padding:  1rem;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  background-color: white;
  transition: $transition;
  box-sizing: border-box;
  font-size: 1rem;
  margin-bottom: 0;
  
  &:focus {
    outline: none;
    border-color: $primary-color;
  }

  // readonly style
  &[readonly] {
    background-color: #f3f4f6;
    cursor: not-allowed;
  }
}

@mixin tablet {
  @media (max-width: $tablet) {
    @content;
  }
}

@mixin mobile {
  @media (max-width: $mobile) {
    @content;
  }
}

// Base styles
.donation-form {
  // max-width: 800px;
  max-width: 100%;
  margin: 0 auto;
  background: white;
  border: 1px solid $border-color;
  overflow: hidden;
  border-radius: $border-radius;
  font-size: 1rem;
  
  @include tablet {
    // max-width: 95%;
  }
  
  @include mobile {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }

  // Header styles
  &__header {
    padding: 2rem;
    // background: $background-color;
    border-bottom: 1px solid $border-color;
    
    @include tablet {
      padding: 1.5rem;
    }
    
    @include mobile {
      padding: 1rem;
    }
  }

  &__campaign {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: center;
    
    @include tablet {
      // grid-template-columns: 1fr;
      // text-align: center;
    }

    &-thumbnail {
      width: 120px;
      height: 120px;
      overflow: hidden;
      border: 1px solid $border-color;
      border-radius: $border-radius;
      
      @include tablet {
        // width: 80px;
        // height: 80px;
        // margin: 0 auto;
      }
      
      @include mobile {
        width: 60px;
        height: 60px;
      }

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }

    &-title {
      // font-size: 2rem;
      font-weight: bold;
      color: $text-color;
      margin: 0 0 0.5rem 0;
      
      @include mobile {
        font-size: 1.25rem;
      }
    }

    &-progress {
      margin-top: 0.5rem;
      color: $text-light;
      // font-size: 0.875rem;

      .giftflow-currency-formatted-amount {
        color: $text-color;
        font-weight: 600;
      }
    }
  }

  // Steps navigation
  &__step-nav {
    padding: 1.5rem 2rem;
    background: $background-color;
    border-bottom: 1px solid $border-color;
    
    @include tablet {
      padding: 1.25rem 1.5rem;
    }
    
    @include mobile {
      padding: 1rem;
    }
  }

  &__step-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    align-items: center;

    @include tablet {
      // flex-direction: column;
      gap: 0.75rem;
    }
    
    @include mobile {
      gap: 0.5rem;
    }
    
  }

  &__step-separator {
    flex: 1 1 0;
    border-bottom: 1px solid $border-color;
  }

  &__step-item {
    // flex: 1;
    text-align: center;
    
    @include tablet {
      text-align: left;
    }
  }

  &__step-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: $text-light;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: $transition;
    
    @include mobile {
      padding: 0.5rem;
    }

    &.is-active {
      // color: $primary-color;
      // background: rgba($primary-color, 0.1);

      .donation-form__step-number {
        background: $primary-color;
        color: white;
      }
    }
  }

  &__step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: $border-color;
    color: $text-light;
    font-size: 1rem;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    
    @include mobile {
      width: 28px;
      height: 28px;
      min-width: 28px;
      font-size: 0.875rem;
    }
  }

  // Step content
  &__step-panel {
    display: none;
    padding: 2rem;
    
    @include tablet {
      padding: 1.5rem;
    }
    
    @include mobile {
      padding: 1rem;
    }

    &.is-active {
      display: block;
    }
  }

  &__fieldset {
    border: none;
    margin: 0 0 2rem;
    padding: 0;
    border-top: solid 1px $border-color;
    
    @include mobile {
      margin: 0 0 1.5rem;
    }
  }

  &__legend {
    font-weight: 600;
    color: $text-color;
    margin-bottom: 1rem;
    padding: 0 1rem 0 0;
    
    @include mobile {
      margin-bottom: 0.75rem;
    }
  }

  // Radio group
  &__radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;

    @include tablet {
      grid-template-columns: 1fr;
    }

    // Donation type: select-style, one option per line
    &--donation-type {
      display: flex;
      flex-direction: column;
      gap: 0;
      border: 1px solid $border-color;
      border-radius: $border-radius;
      overflow: hidden;
      background: white;
    }
  }

  // Single-row radio option (donation type): select-one pattern with checked icon + standard active state
  &__radio-option {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    transition: $transition;
    border-bottom: 1px solid $border-color;
    position: relative;

    &:last-child {
      border-bottom: none;
    }

    input[type="radio"] {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;

      &:focus-visible + .donation-form__radio-option-content {
        outline: 2px solid $primary-color;
        outline-offset: 2px;
      }
    }
  }

  &__radio-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    padding: 1rem 1.25rem;
    min-width: 0;
    border-left: 3px solid transparent;
    transition: $transition;

    @include mobile {
      padding: 0.875rem 1rem;
    }

    .donation-form__radio-option:hover & {
      background-color: rgba(0, 0, 0, 0.02);
    }

    // Standard active state: subtle background, accent border; selection conveyed by checked icon
    .donation-form__radio-option input[type="radio"]:checked + & {
      background-color: rgba(0, 0, 0, 0.04);
      border-left-color: $primary-color;

      .donation-form__radio-option-title {
        
        &:after {
          content: "Selected";
          display: inline-block;
          padding: .2em 0.65em;
          margin-left: 0.25em;
          font-size: 0.75em;
          border-radius: 1em;
          background-color: var(--giftflow-primary-color);
          color: #fff;
          font-weight: 600;
          height: auto;
          line-height: 1.5;
          vertical-align: middle;
        }
      }
    }
  }

  // Checked icon: visible only when this option is selected
  &__radio-option-check {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    margin-right: 1rem;
    color: $primary-color;
    opacity: 0;
    transition: $transition;
    position: absolute;
    right: 1rem;

    .donation-form__radio-option input[type="radio"]:checked ~ & {
      opacity: 1;
    }

    svg {
      width: 100%;
      height: 100%;
      display: block;
    }
  }

  &__radio-option-title {
    font-weight: 500;
    color: $text-color;
    display: flex;
    align-items: center;
    gap: 0.5rem;

    svg {
      width: 20px;
      height: 20px;
      flex-shrink: 0;
    }
  }

  &__radio-option-description {
    font-size: 0.875rem;
    color: $text-light;
    line-height: 1.4;
    max-width: 85%;
    text-transform: none;
    letter-spacing: 0;

    @include mobile {
      font-size: 0.8125rem;
    }
  }

  // Legacy radio label/content (e.g. other radio groups)
  &__radio-label {
    position: relative;
    display: block;
    padding: 1.5rem;
    border: 1px solid $border-color;
    cursor: pointer;
    transition: $transition;
    border-radius: $border-radius;

    &:hover {
      border-color: $primary-color;
    }

    @include mobile {
      padding: 1rem;
    }

    input[type="radio"] {
      position: absolute;
      opacity: 0;

      &:checked + .donation-form__radio-content {
        color: $primary-color;
      }
    }
  }

  &__radio-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    align-items: center;

    svg {
      width: 20px;
      height: 20px;
    }
  }

  &__radio-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  &__radio-description {
    font-size: 0.875rem;
    color: $text-light;

    @include mobile {
      font-size: 0.75rem;
    }
  }

  // Amount input
  &__amount {
    &-input {
      position: relative;
      margin-bottom: 1rem;

      .donation-form__currency {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: $text-light;
      }

      input {
        @include input-style;
        font-size: 1.25rem;
        font-weight: 600;
        text-align: center;
        padding-left: 2.5rem;
        font-family: $font-family-monospace;
        margin-bottom: 0;
        
        @include mobile {
          font-size: 1rem;
        }

        &.error {
          border-color: $error-color;
        }

        &:disabled {
          background-color: #f0f0f0;
          // color: #b0b0b0;
          cursor: not-allowed;
        }
      }
    }
  }

  &__preset-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    
    @include mobile {
      grid-template-columns: repeat(2, 1fr);
      gap: .5rem;
    }

    button {
      padding: 1rem;
      border: 1px solid $border-color;
      background: white; 
      color: $text-color;
      cursor: pointer;
      transition: $transition;
      border-radius: $border-radius;
      font-family: $font-family-monospace;
      letter-spacing: 0;
      font-size: .9rem;

      > * {
        pointer-events: none;
      }
      
      @include mobile {
        padding: 0.75rem 0.5rem;
      }

      &:hover {
        border-color: $primary-color;
        color: $primary-color;
      }

      &.active {
        border-color: $primary-color;
        background: $primary-color;
        color: white;
      }
    }
  }

  // Form fields
  &__fields,
  &__card-fields {
    display: grid;
    gap: 1rem;
  }

  &__field {
    label {
      display: block;
      margin-bottom: 0.5rem;
      font-weight: 500;
      font-size: 0.9rem;
      color: $text-light;
    }

    input[type="text"], input[type="email"], input[type="tel"], textarea {
      @include input-style;
    }

    &.error {
      label {
        color: $error-color;
      }

      input[type="text"], input[type="email"], input[type="tel"], textarea {
        border-color: $error-color;
      }

      .donation-form__field-error {
        display: flex;
      }
    }

    &-error {
      display: none;
      align-items: center;
      gap: 0.3rem;
      color: $error-color;
      font-size: 0.7rem;
      margin-top: 0.5rem;
      font-weight: 600;
    }

    // input[type="checkbox"], input[type="radio"] {
    //   margin: 0 0.5rem 0 0;

    // }

    textarea {
      min-height: 100px;
      resize: vertical;
      
      @include mobile {
        min-height: 80px;
      }
    }
  }

  &__checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
    cursor: pointer;

    input[type="checkbox"] {
      margin: 0 0.5rem 0 0;
      width: 16px;
      height: 16px;
      vertical-align: middle;
      opacity: 1;
    }
  }

  // Payment methods
  &__payment-methods {
    display: grid;
    gap: 1rem;
  }

  &__payment-method-item {
    background-color: #f9f9f9;
    border-radius: $border-radius;
    border: 1px solid $border-color;

    &.gfw-disabled-payment-gateway {
      opacity: 0.3;
      pointer-events: none;
      cursor: not-allowed;

      &:after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
      }
    }

    &:not(.is-active) {
      
      label.donation-form__payment-method {
        border-bottom-color: transparent;
      }
    }

    &.is-active {
      
      .donation-form__payment-method-description {
        // display: grid;
      }
    }
  }

  &__payment-method {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    // border: 1px solid $border-color;
    cursor: pointer;
    transition: $transition;
    // border-radius: $border-radius;
    border-bottom: 1px solid $border-color;
    
    @include mobile {
      padding: 0.75rem;
    }

    input[type="radio"] {
      margin: 0;
      opacity: 1;
    }

    &-content {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: $text-color;

      svg {
        stroke: $text-color;
      }
    }

    svg {
      width: 20px;
      height: 20px;
      stroke: black;
      
      @include mobile {
        width: 16px;
        height: 16px;
      }
    }

    &:hover {
      // border-color: $primary-color;
    }
  }

  // Summary
  &__summary {
    margin-top: 2rem;
    padding: 1.5rem;
    background: $background-color;
    border: 1px solid $border-color;
    border-radius: $border-radius;
    @include mobile {
      margin-top: 1.5rem;
      padding: 1rem;
    }

    &-title {
      margin: 0 0 1rem;
      padding-bottom: 1rem;
      border-bottom: 1px solid $border-color;
      font-size: 1.25rem;
      font-weight: 600;
      color: $text-color;
      
      @include mobile {
        font-size: 1.125rem;
        margin: 0 0 0.75rem;
        padding-bottom: 0.75rem;
      }
    }

    &-list {
      margin: 0;
      padding: 0;
    }

    &-item {
      @include flex-between;
      margin-bottom: 0.75rem;
      
      @include mobile {
        margin-bottom: 0.5rem;
      }

      dt {
        color: $text-light;
      }

      dd {
        margin: 0;
        font-weight: 500;
        color: $text-color;
        white-space: nowrap;
        max-width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }

  // Step actions
  &__step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    
    @include tablet {
      flex-direction: column-reverse;
      margin-top: 1.5rem;
    }
    
    @include mobile {
      gap: 0.75rem;
    }
  }

  &__button {
    padding: 1.3rem 1rem;
    border-radius: $border-radius;
    font-weight: 500;
    cursor: pointer;
    transition: $transition;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.5rem;
    letter-spacing: 0;

    > * {
      pointer-events: none;
    }

    @include tablet {
      width: 100%;
      padding: 0.875rem 1rem;
    }

    &--next,
    &--submit {
      background: $primary-color;
      color: white;
      border: none;

      &.disabled {
        background: #f0f0f0;
        color: #b0b0b0;
        cursor: not-allowed;
        pointer-events: none;
      }

      &:hover {
        filter: brightness(0.9);
      }
    }

    &.loading {
      cursor: not-allowed;
      opacity: 0.7;
      position: relative;
      overflow: hidden;

      &::after {
        content: "";
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        animation: loading-shimmer 1.5s infinite;
      }

      @keyframes loading-shimmer {
        0% {
          left: -100%;
        }
        100% {
          left: 100%;
        }
      }

      > * {
        pointer-events: none;
      }
    }

    &--back {
      background: white;
      color: $text-color;
      border: 1px solid $border-color;

      &:hover {
        border-color: $primary-color;
        color: $primary-color;
      }
    }

    &:hover {
      // transform: translateY(-1px);
      gap: 0.75rem;
    }
  }

  &__security-notice {
    padding: 1.5rem 1rem;
    margin-top: 1.5rem;
    background-color: #f8f9fa;
    border-radius: $border-radius;
    border-left: 3px solid $secondary-color;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    p {
      margin: 0;
      font-size: 0.9rem;
      // color: $text-light;
      display: flex;
      align-items: center;
    }
    
    @include tablet {
      padding: 1.25rem;
      margin-top: 1.25rem;
    }
    
    @include mobile {
      padding: 1rem;
      margin-top: 1rem;
    }
  }

  &__security-notice-icon {
    margin-right: 0.5rem;
    font-size: 1.25rem;
    display: flex;
  }

  &__bank-details {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    border-radius: $border-radius;
    padding: 1rem;
    border: 1px solid $border-color;
    background: white;

    @include tablet {
      padding: 0.75rem;
      gap: 0.4rem;
    }
    @include mobile {
      padding: 0.5rem;
      gap: 0.3rem;
    }
  }

  &__bank-instructions {
    color: $text-color;

    > p {
      margin: 0 0 .5rem;
    }
  }

  &__bank-detail {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 0.75rem 2rem;
    font-size: .85rem;
    color: $text-light;
    padding: 0.25rem 0;

    @include tablet {
      grid-template-columns: 1fr;
      gap: 0.4rem 0;
      font-size: 0.90rem;
      padding: 0.3rem 0;
    }
    @include mobile {
      grid-template-columns: 1fr;
      gap: 0.25rem 0;
      font-size: 1rem;
      padding: 0.2rem 0;
    }

    strong {
      font-weight: 500;
      // color: $text-color;
      letter-spacing: 0.01em;
      min-width: 120px;
      white-space: nowrap;

      @include tablet {
        min-width: unset;
        white-space: normal;
      }
      @include mobile {
        min-width: unset;
        white-space: normal;
        font-size: 1em;
      }
    }

    span {
      font-weight: 400;
      color: $text-color;
      letter-spacing: 0.01em;
      word-break: break-all;

      @include tablet {
        font-size: 1em;
      }
      @include mobile {
        font-size: 1em;
      }
    }
  }
}


// Responsive styles
@media (max-width: 768px) {
  .donation-form {
    &__campaign {
      // grid-template-columns: 1fr;

      &-thumbnail {
        // width: 80px;
        // height: 80px;
      }
    }

    &__radio-group {
      grid-template-columns: 1fr;
    }

    &__step-actions {
      flex-direction: column-reverse;

      button {
        width: 100%;
      }
    }
  }
}

@media (max-width: 555px) {
  .donation-form {
    
    &__header {

    }

    &__campaign-title {
      font-size: max(1.25rem, 1.5em);
    }
  }

  .giftflow-modal {

    .donation-form__campaign-thumbnail {  
      display: none;
    }

    .donation-form__campaign-title {
      padding-right: 26px;
    }

    .donation-form__step-item { 
      font-size: .9em;
    }
  }
}

@media (max-width: 480px) {
  .donation-form {

    &__campaign-title {
      // font-size: max(1rem, 1.25em);
    }

    &__preset-amounts {
      grid-template-columns: repeat(2, 1fr);
    }
    
    &__campaign-thumbnail {
      width: 60px;
      height: 60px;
    }
    
    &__step-panel {
      padding: 1rem;
    }
  }
}

// Stripe Card Element Styling
.donation-form {
  &__payment-method-description {
    // margin-top: 0.75rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: $border-radius;
    font-size: 0.875rem;

    // display: none;
    // color: $text-light;
    // line-height: .8;

    &--stripe {
      // Payment Request Button (Apple Pay / Google Pay)
      .payment-request-button-wrapper {
        margin-bottom: 1.5rem;

        #payment-request-button {
          // Stripe Payment Request Button will be mounted here
          button {
            width: 100%;
            height: 48px;
            border-radius: $border-radius;
            transition: $transition;

            &:hover {
              opacity: 0.9;
            }
          }
        }
      }

      // Separator between wallet and card payment
      .payment-request-separator {
        display: flex;
        align-items: center;
        text-align: center;
        // margin: 1.5rem 0;
        color: $text-color;
        font-size: 0.8rem;

        &::before,
        &::after {
          content: '';
          flex: 1;
          border-bottom: 1px solid $border-color;
        }

        span {
          padding: 0 1rem;
          font-weight: 500;
          text-transform: uppercase;
          letter-spacing: 0.025em;
        }
      }

      #STRIPE-CARD-ELEMENT {
        margin-top: 1rem;
        padding: 1rem;
        border: 1px solid $border-color;
        border-radius: $border-radius;
        background-color: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        transition: $transition;

        &:focus-within {
          border-color: $primary-color;
          box-shadow: 0 0 0 2px rgba($primary-color, 0.2);
        }

        // Stripe iframe container
        .StripeElement {
          width: 100%;
          min-height: 40px;
        }
      }

      @include mobile {
        .payment-request-button-wrapper {
          margin-bottom: 1rem;
        }

        .payment-request-separator {
          margin: 1rem 0;
          font-size: 0.8125rem;
        }
      }
    }
    
    @include mobile {
      padding: 0.75rem;
      font-size: 0.8125rem;
      
      #STRIPE-CARD-ELEMENT {
        padding: 0.75rem;
      }
    }
  }

  .custom-error {
    border-color: $error-color;

    .custom-error-message {
      display: flex;
    }
  }
  
  &__payment-notification,
  &__notification {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: color-mix(in srgb, var(--giftflow-primary-color) 5%, transparent);
    border-radius: $border-radius;
    border: 1px solid $border-color;

    .notification-icon {
      flex-shrink: 0;
      color: $primary-color;

      svg {
        width: 20px;
        height: auto;
        margin: 0;
        color: currentColor;
      }
    }
    
    p {
      margin: 0;
      font-size: 0.8125rem;
      color: #313131;
      line-height: 1.4;
    }

    &--warning {
      background-color: color-mix(in srgb, var(--giftflow-error-color) 5%, transparent);
      border-color: color-mix(in srgb, var(--giftflow-error-color) 20%, transparent);
      color: var(--giftflow-error-color);
    }
    
    @include mobile {
      padding: 0.625rem;
      
      .notification-icon {
        margin-right: 0.5rem;
        width: 14px;
        height: 14px;
      }
      
      p {
        font-size: 0.75rem;
      }
    }
  }

}

// Thank you page styles
.donation-form {
  &__thank-you {
    text-align: center;
    padding: 3rem 2rem;
    
    @include mobile {
      padding: 2rem 1rem;
    }

    svg {
      width: 64px;
      height: 64px;
      color: $success-color;
      margin-bottom: 1.5rem;
      
      @include mobile {
        width: 48px;
        height: 48px;
        margin-bottom: 1rem;
      }
    }
  }

  &__thank-you-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: $text-color;
    margin: 0 0 1.5rem;
    
    @include mobile {
      font-size: 1.5rem;
      margin: 0 0 1rem;
    }
  }

  &__thank-you-message {
    color: $text-light;
    margin: 0 0 2rem;
    font-size: 1.1rem;
    line-height: 1.6;
    
    @include mobile {
      font-size: 1rem;
      margin: 0 0 1.5rem;
    }
  }

  &__thank-you-summary {
    background: $background-color;
    padding: 1.5rem;
    border-radius: $border-radius;
    margin-bottom: 2rem;
    
    @include mobile {
      padding: 1rem;
      margin-bottom: 1.5rem;
    }
  }

  &__thank-you-amount {
    font-size: 2rem;
    font-weight: 600;
    color: $success-color;
    margin-bottom: 0.5rem;
    
    @include mobile {
      font-size: 1.5rem;
    }
  }

  &__thank-you-campaign {
    color: $text-light;
    font-size: 0.9rem;
  }

  &__thank-you-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    
    @include mobile {
      flex-direction: column;
    }

    .donation-form__button {
      min-width: 200px;
      
      @include mobile {
        width: 100%;
        min-width: auto;
      }

      &--share {
        background-color: color-mix(in srgb, var(--giftflow-secondary-color) 10%, transparent);
        color: var(--giftflow-secondary-color);
        border: 1px solid color-mix(in srgb, var(--giftflow-secondary-color) 20%, transparent);
        box-shadow: 0 1px 2px color-mix(in srgb, var(--giftflow-secondary-color) 5%, transparent);

        &:hover {
          background-color: color-mix(in srgb, var(--giftflow-secondary-color) 15%, transparent);
          border-color: color-mix(in srgb, var(--giftflow-secondary-color) 30%, transparent);
          transform: translateY(-1px);
          box-shadow: 0 2px 4px color-mix(in srgb, var(--giftflow-secondary-color) 10%, transparent);
        }

        svg {
          width: 20px;
          height: 20px;
          margin: 0;
          color: currentColor;
        }
      }
    }
  }

  &__amount-notification {
    align-items: start;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: $background-color;
    border-radius: $border-radius;
    display: flex;
    gap: .7rem;
    font-size: 0.8em;
    line-height: 1.5em;
    border: 1px solid $border-color;
    color: #313131;

    .notification-message-icon {
      color: $primary-color;

      svg {
        width: 20px;
        height: auto;
        margin: 0;
        color: currentColor;
      }
    }

    .notification-message-entry {
      
    }
  }
}

// Error page styles
.donation-form {
  &__error {
    text-align: center;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    
    @include mobile {
      padding: 2rem 1rem;
      gap: 1rem;
    }

    svg {
      width: 64px;
      height: 64px;
      color: $error-color;
      
      @include mobile {
        width: 48px;
        height: 48px;
      }
    }
  }

  &__error-content {
    max-width: 600px;
    margin: 0 auto;
  }

  &__error-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: $text-color;
    margin: 0 0 1.5rem;
    
    @include mobile {
      font-size: 1.5rem;
      margin: 0 0 1rem;
    }
  }

  &__error-message {
    color: $error-color;
    font-weight: 500;
    margin: 0 0 1.5rem;
    
    @include mobile {
      margin: 0 0 1rem;
    }
  }

  &__error-help {
    color: $text-light;
    margin: 0 0 1rem;
  }

  &__error-tips {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    
    li {
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
      color: $text-color;
      font-weight: 500;
      padding-left: 1.5rem;
      position: relative;
      
      &:before {
        content: "•";
        color: $error-color;
        position: absolute;
        left: 0;
        top: 0;
        font-size: 1.5rem;
        line-height: 1;
      }

      small {
        color: $text-light;
        font-size: 0.875rem;
        font-weight: normal;
        
        @include mobile {
          font-size: 0.8125rem;
        }
      }
    }
    
    @include mobile {
      gap: 0.75rem;
      margin: 0 0 1.5rem;
    }
  }

  &__error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    
    @include mobile {
      flex-direction: column;
    }

    .donation-form__button {
      min-width: 180px;
      
      @include mobile {
        width: 100%;
        min-width: auto;
      }

      svg {
        width: 20px;
        height: 20px;
        margin: 0;
        color: currentColor;
      }

      &--retry {
        background-color: $primary-color;
        color: white;
        border: none;
      }

      &--support {
        background-color: white;
        color: $text-color;
        border: 1px solid $border-color;
        text-decoration: none;

        &:hover {
          border-color: $primary-color;
          color: $primary-color;
        }
      }
    }
  }
}

// Error styles
.donation-form {
  &__error-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: $error-color;
    margin: 0 0 0.75rem;
    
    @include mobile {
      font-size: 1.125rem;
    }
  }

  &__error-text {
    color: $text-light;
    font-size: 0.925rem;
    line-height: 1.5;
    margin: 0;
    padding: 0.75rem;
    background-color: color-mix(in srgb, $error-color 5%, transparent);
    border-radius: $border-radius;
    border-left: 3px solid $error-color;
    
    @include mobile {
      font-size: 0.875rem;
      padding: 0.625rem;
    }
  }
}

.giftflow-campaign-not-ready-msg {
  padding: 24px;
  text-align: center;
  color: #b71c1c;
  background: #fbebeb;
  border: 1px solid #ffe0e0;
  border-radius: 8px;
  margin: 1em auto;
  font-size: .9em;
}