.sso-app-grid {
  padding: $space-8 0;

  h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--pico-color);
    margin-bottom: $space-6;
    letter-spacing: -0.025em;
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: $space-5;

    @include up($bp-md) {
      grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    }

    @include up($bp-lg) {
      gap: $space-6;
    }
  }

  .no-apps {
    color: var(--pico-muted-color);
    font-size: 1rem;
    padding: $space-6 0;
  }
}

.sso-app-card-form {
  margin: 0;
  height: 100%;
}

.sso-app-card.secondary {
  text-decoration: none;
  height: 100%;

  @include card($padding: 1.75rem, $radius: $radius-lg);
  display: flex;
  flex-direction: column;
  @include transition-default();
  background: #fff linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.02) 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  
  @include dark-mode {
    background: #2c2c2c linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.08) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  
  &:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    background: #fcfcfc linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.01) 100%) !important;
    border: 1px solid #ec3750 !important;
    box-shadow: 
      0 4px 12px rgba(0, 0, 0, 0.1),
      0 0 0 2px rgba(236, 55, 80, 0.1) !important;
    
    @include dark-mode {
      background: #333 linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(0,0,0,0.1) 100%) !important;
      border: 1px solid #f03d58 !important;
      box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(240, 61, 88, 0.15) !important;
    }

    .launch-text {
      color: var(--pico-primary) !important;
    }
  }

  &:active:not(:disabled) {
    transform: translateY(0) !important;
  }

  .card-header {
    display: flex;
    align-items: flex-start;
    gap: $space-3;
    margin-bottom: $space-5;
    min-height: 56px;
  }

  .app-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--pico-primary-background) 0%, var(--pico-primary) 100%);
    border-radius: $radius-lg;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;

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

  .app-info {
    flex: 1;
    min-width: 0;
    text-align: left;

    h3 {
      font-size: 1.125rem;
      font-weight: 600;
      color: var(--pico-color);
      margin: 0 0 0.25rem 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      letter-spacing: -0.01em;
    }

    .app-tagline {
      font-size: 0.875rem;
      color: var(--pico-muted-color);
      margin: 0;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.4;
    }
  }

  .card-footer {
    margin-top: auto;
    padding-top: $space-3;
    border-top: 1px solid var(--pico-card-border-color);
    text-align: center;

    .launch-text {
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--pico-muted-color);
      @include transition-default(all);
      display: inline-block;
      letter-spacing: -0.01em;
    }
  }
}

.home-container {
  @include container();

  .home-footer {
    margin-top: $space-8;
    padding-top: $space-6;
    border-top: 1px solid var(--pico-card-border-color);

    form {
      margin: 0;
    }

    button[type="submit"] {
      background: transparent !important;
      border: none !important;
      color: var(--pico-muted-color) !important;
      font-size: 0.875rem !important;
      padding: $space-1 $space-3 !important;
      cursor: pointer;
      @include transition-default(color);
      margin: 0 !important;
      box-shadow: none !important;
      transform: none !important;

      &:hover {
        color: var(--pico-color) !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
      }
    }
  }
}
